7000559: G1: assertion failure !outer || (full_collections_started == _full_collections_completed + 1)

The concurrent marking thread can complete its operation and increment the full GC counter during a Full GC. This causes the nesting of increments to the start and end of Full GCs that we are expecting to be wrong. the fix is for the marking thread to join the suspendible thread set before incrementing the counter so that it's blocked until the Full GC (or any other safepoint) is finished. The change also includes some minor code cleanup (I renamed a parameter).

Reviewed-by: brutisso, ysr
This commit is contained in:
Antonios Printezis 2010-12-14 16:19:44 -05:00
parent 874098b1c6
commit 727333a1a3
3 changed files with 25 additions and 17 deletions

View file

@ -277,7 +277,9 @@ void ConcurrentMarkThread::run() {
// completed. This will also notify the FullGCCount_lock in case a
// Java thread is waiting for a full GC to happen (e.g., it
// called System.gc() with +ExplicitGCInvokesConcurrent).
g1->increment_full_collections_completed(true /* outer */);
_sts.join();
g1->increment_full_collections_completed(true /* concurrent */);
_sts.leave();
}
assert(_should_terminate, "just checking");