6652160: G1: assert(cur_used_bytes == _g1->recalculate_used(),"It should!") at g1CollectorPolicy.cpp:1425
authoriveresov
Wed, 30 Jul 2008 10:45:52 -0700
changeset 1386 e20a51f0d970
parent 1385 1751733b089b
child 1387 580d4ae0a776
6652160: G1: assert(cur_used_bytes == _g1->recalculate_used(),"It should!") at g1CollectorPolicy.cpp:1425 Summary: In attempt_allocation_slow() wait for the concurrent cleanup to complete before modifying _summary_bytes_used. Reviewed-by: jmasa, apetrusenko
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Jul 10 09:29:54 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 30 10:45:52 2008 -0700
@@ -648,6 +648,12 @@
            "Prevent a regression of this bug.");
 
   } else {
+    // We may have concurrent cleanup working at the time. Wait for it
+    // to complete. In the future we would probably want to make the
+    // concurrent cleanup truly concurrent by decoupling it from the
+    // allocation.
+    if (!SafepointSynchronize::is_at_safepoint())
+      wait_for_cleanup_complete();
     // If we do a collection pause, this will be reset to a non-NULL
     // value.  If we don't, nulling here ensures that we allocate a new
     // region below.