From 09fd47bcefc6e067870cb87d079ec110422a5c6e Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Wed, 30 Jul 2008 10:45:52 -0700 Subject: [PATCH] 6652160: G1: assert(cur_used_bytes == _g1->recalculate_used(),"It should!") at g1CollectorPolicy.cpp:1425 In attempt_allocation_slow() wait for the concurrent cleanup to complete before modifying _summary_bytes_used. Reviewed-by: jmasa, apetrusenko --- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index bf892425c82..7e61e4f4916 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -648,6 +648,12 @@ G1CollectedHeap::attempt_allocation_slow(size_t word_size, "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.