< prev index next >

src/share/vm/gc/g1/g1ConcurrentMark.cpp

Print this page
rev 12685 : 8176565: G1 Does not perform heap verification after remark with VerifyAfterGC
Reviewed-by:


1137     _restart_for_overflow = true;
1138 
1139     // Verify the heap w.r.t. the previous marking bitmap.
1140     if (VerifyDuringGC) {
1141       HandleMark hm;  // handle scope
1142       g1h->prepare_for_verify();
1143       Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (overflow)");
1144     }
1145 
1146     // Clear the marking state because we will be restarting
1147     // marking due to overflowing the global mark stack.
1148     reset_marking_state();
1149   } else {
1150     SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
1151     // We're done with marking.
1152     // This is the end of  the marking cycle, we're expected all
1153     // threads to have SATB queues with active set to true.
1154     satb_mq_set.set_active_all_threads(false, /* new active value */
1155                                        true /* expected_active */);
1156 
1157     if (VerifyDuringGC) {
1158       HandleMark hm;  // handle scope
1159       g1h->prepare_for_verify();
1160       Universe::verify(VerifyOption_G1UseNextMarking, "During GC (after)");
1161     }
1162     g1h->verifier()->check_bitmaps("Remark End");
1163     assert(!restart_for_overflow(), "sanity");
1164     // Completely reset the marking state since marking completed
1165     set_non_marking_state();
1166   }
1167 
1168   // Expand the marking stack, if we have to and if we can.
1169   if (_global_mark_stack.should_expand()) {
1170     _global_mark_stack.expand();
1171   }
1172 
1173   // Statistics
1174   double now = os::elapsedTime();
1175   _remark_mark_times.add((mark_work_end - start) * 1000.0);
1176   _remark_weak_ref_times.add((now - mark_work_end) * 1000.0);
1177   _remark_times.add((now - start) * 1000.0);




1137     _restart_for_overflow = true;
1138 
1139     // Verify the heap w.r.t. the previous marking bitmap.
1140     if (VerifyDuringGC) {
1141       HandleMark hm;  // handle scope
1142       g1h->prepare_for_verify();
1143       Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (overflow)");
1144     }
1145 
1146     // Clear the marking state because we will be restarting
1147     // marking due to overflowing the global mark stack.
1148     reset_marking_state();
1149   } else {
1150     SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
1151     // We're done with marking.
1152     // This is the end of  the marking cycle, we're expected all
1153     // threads to have SATB queues with active set to true.
1154     satb_mq_set.set_active_all_threads(false, /* new active value */
1155                                        true /* expected_active */);
1156 
1157     if (VerifyDuringGC || VerifyAfterGC) {
1158       HandleMark hm;  // handle scope
1159       g1h->prepare_for_verify();
1160       Universe::verify(VerifyOption_G1UseNextMarking, "During GC (after)");
1161     }
1162     g1h->verifier()->check_bitmaps("Remark End");
1163     assert(!restart_for_overflow(), "sanity");
1164     // Completely reset the marking state since marking completed
1165     set_non_marking_state();
1166   }
1167 
1168   // Expand the marking stack, if we have to and if we can.
1169   if (_global_mark_stack.should_expand()) {
1170     _global_mark_stack.expand();
1171   }
1172 
1173   // Statistics
1174   double now = os::elapsedTime();
1175   _remark_mark_times.add((mark_work_end - start) * 1000.0);
1176   _remark_weak_ref_times.add((now - mark_work_end) * 1000.0);
1177   _remark_times.add((now - start) * 1000.0);


< prev index next >