src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page
rev 4702 : 8015244: G1: Verification after a full GC is incorrectly placed.
Summary: In a full GC, move the verification after the GC to after RSet rebuilding. Verify RSet entries during a full GC under control of a flag.
Reviewed-by:

@@ -1415,12 +1415,10 @@
 
       COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
 
       MemoryService::track_memory_usage();
 
-      verify_after_gc();
-
       assert(!ref_processor_stw()->discovery_enabled(), "Postcondition");
       ref_processor_stw()->verify_no_references_recorded();
 
       // Delete metaspaces for unloaded class loaders and clean up loader_data graph
       ClassLoaderDataGraph::purge();

@@ -1519,10 +1517,12 @@
       increment_old_marking_cycles_completed(false /* concurrent */);
 
       _hrs.verify_optional();
       verify_region_sets_optional();
 
+      verify_after_gc();
+
       // Start a new incremental collection set for the next pause
       assert(g1_policy()->collection_set() == NULL, "must be");
       g1_policy()->start_incremental_cset_building();
 
       // Clear the _cset_fast_test bitmap in anticipation of adding