Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @ 6120:37552638d24a
7172388: G1: _total_full_collections should not be incremented for concurrent cycles
Reviewed-by: azeemj, jmasa
author | brutisso |
---|---|
date | Tue, 05 Jun 2012 22:30:24 +0200 |
parents | 1096fc5a52eb |
children | f2110083203d |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp Mon Jun 04 09:21:53 2012 +0200 +++ b/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp Tue Jun 05 22:30:24 2012 +0200 @@ -64,7 +64,7 @@ _should_initiate_conc_mark(should_initiate_conc_mark), _target_pause_time_ms(target_pause_time_ms), _should_retry_gc(false), - _full_collections_completed_before(0) { + _old_marking_cycles_completed_before(0) { guarantee(target_pause_time_ms > 0.0, err_msg("target_pause_time_ms = %1.6lf should be positive", target_pause_time_ms)); @@ -112,11 +112,11 @@ GCCauseSetter x(g1h, _gc_cause); if (_should_initiate_conc_mark) { - // It's safer to read full_collections_completed() here, given + // It's safer to read old_marking_cycles_completed() here, given // that noone else will be updating it concurrently. Since we'll // only need it if we're initiating a marking cycle, no point in // setting it earlier. - _full_collections_completed_before = g1h->full_collections_completed(); + _old_marking_cycles_completed_before = g1h->old_marking_cycles_completed(); // At this point we are supposed to start a concurrent cycle. We // will do so if one is not already in progress. @@ -181,17 +181,17 @@ G1CollectedHeap* g1h = G1CollectedHeap::heap(); - // In the doit() method we saved g1h->full_collections_completed() - // in the _full_collections_completed_before field. We have to - // wait until we observe that g1h->full_collections_completed() + // In the doit() method we saved g1h->old_marking_cycles_completed() + // in the _old_marking_cycles_completed_before field. We have to + // wait until we observe that g1h->old_marking_cycles_completed() // has increased by at least one. This can happen if a) we started // a cycle and it completes, b) a cycle already in progress // completes, or c) a Full GC happens. // If the condition has already been reached, there's no point in // actually taking the lock and doing the wait. - if (g1h->full_collections_completed() <= - _full_collections_completed_before) { + if (g1h->old_marking_cycles_completed() <= + _old_marking_cycles_completed_before) { // The following is largely copied from CMS Thread* thr = Thread::current(); @@ -200,8 +200,8 @@ ThreadToNativeFromVM native(jt); MutexLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag); - while (g1h->full_collections_completed() <= - _full_collections_completed_before) { + while (g1h->old_marking_cycles_completed() <= + _old_marking_cycles_completed_before) { FullGCCount_lock->wait(Mutex::_no_safepoint_check_flag); } }