mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8058568: GC cleanup phase can cause G1 skipping a System.gc()
Marking G1 FullGC as a _full collection and passing down the correct before count. Reviewed-by: brutisso, mgerdin
This commit is contained in:
parent
71edbb2d96
commit
bd227a9bac
2 changed files with 4 additions and 2 deletions
|
@ -2483,6 +2483,7 @@ void G1CollectedHeap::collect(GCCause::Cause cause) {
|
|||
|
||||
unsigned int gc_count_before;
|
||||
unsigned int old_marking_count_before;
|
||||
unsigned int full_gc_count_before;
|
||||
bool retry_gc;
|
||||
|
||||
do {
|
||||
|
@ -2493,6 +2494,7 @@ void G1CollectedHeap::collect(GCCause::Cause cause) {
|
|||
|
||||
// Read the GC count while holding the Heap_lock
|
||||
gc_count_before = total_collections();
|
||||
full_gc_count_before = total_full_collections();
|
||||
old_marking_count_before = _old_marking_cycles_started;
|
||||
}
|
||||
|
||||
|
@ -2537,7 +2539,7 @@ void G1CollectedHeap::collect(GCCause::Cause cause) {
|
|||
VMThread::execute(&op);
|
||||
} else {
|
||||
// Schedule a Full GC.
|
||||
VM_G1CollectFull op(gc_count_before, old_marking_count_before, cause);
|
||||
VM_G1CollectFull op(gc_count_before, full_gc_count_before, cause);
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue