--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-08-04 14:27:25.517451710 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-08-04 14:27:25.389449892 +0200 @@ -1968,7 +1968,7 @@ } void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent, - bool liveness_completed) { + bool whole_heap_examined) { MonitorLocker ml(G1OldGCCount_lock, Mutex::_no_safepoint_check_flag); // We assume that if concurrent == true, then the caller is a @@ -2000,7 +2000,7 @@ _old_marking_cycles_started, _old_marking_cycles_completed); _old_marking_cycles_completed += 1; - if (liveness_completed) { + if (whole_heap_examined) { next_whole_heap_examined(); } --- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2020-08-04 14:27:26.069459538 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2020-08-04 14:27:25.941457723 +0200 @@ -646,9 +646,10 @@ // the G1OldGCCount_lock in case a Java thread is waiting for a full // GC to happen (e.g., it called System.gc() with // +ExplicitGCInvokesConcurrent). - // liveness_completed should indicate that during that old marking - // cycle the whole heap has actually been examined for live objects. - void increment_old_marking_cycles_completed(bool concurrent, bool liveness_completed); + // whole_heap_examined should indicate that during that old marking + // cycle the whole heap has been examined for live objects (as opposed + // to only parts, or aborted before completion). + void increment_old_marking_cycles_completed(bool concurrent, bool whole_heap_examined); uint old_marking_cycles_completed() { return _old_marking_cycles_completed; --- old/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-08-04 14:27:26.573466686 +0200 +++ new/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-08-04 14:27:26.449464928 +0200 @@ -1044,6 +1044,8 @@ // clearing policy at the next gc. Universe::update_heap_info_at_gc(); + Universe::heap()->next_whole_heap_examined(); + bool young_gen_empty = eden_empty && from_space->is_empty() && to_space->is_empty(); @@ -1068,8 +1070,6 @@ if (ZapUnusedHeapArea) { heap->gen_mangle_unused_area(); } - - Universe::heap()->next_whole_heap_examined(); } HeapWord* --- old/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp 2020-08-04 14:27:27.109474287 +0200 +++ new/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp 2020-08-04 14:27:26.981472473 +0200 @@ -235,6 +235,9 @@ // global soft refs policy, and we better report it every time heap // usage goes down. Universe::update_heap_info_at_gc(); + + // Signal that we have completed a visit to all live objects. + Universe::heap()->next_whole_heap_examined(); } // Disable forced counters update, and update counters one more time @@ -275,8 +278,6 @@ // Print Metaspace change following GC (if logging is enabled). MetaspaceUtils::print_metaspace_change(meta_sizes); - heap->next_whole_heap_examined(); - // GC is over, we are at idle now if (ShenandoahPacing) { heap->pacer()->setup_for_idle(); --- old/src/hotspot/share/gc/z/zDriver.cpp 2020-08-04 14:27:27.593481154 +0200 +++ new/src/hotspot/share/gc/z/zDriver.cpp 2020-08-04 14:27:27.469479396 +0200 @@ -381,6 +381,9 @@ // Update data used by soft reference policy Universe::update_heap_info_at_gc(); + + // Signal that we have completed a visit to all live objects + Universe::heap()->next_whole_heap_examined(); } }; --- old/src/hotspot/share/gc/z/zStat.cpp 2020-08-04 14:27:28.073487963 +0200 +++ new/src/hotspot/share/gc/z/zStat.cpp 2020-08-04 14:27:27.949486204 +0200 @@ -1048,9 +1048,6 @@ const double duration = (_end_of_last - _start_of_last).seconds(); const double normalized_duration = duration * boost_factor; _normalized_duration.add(normalized_duration); - - // Signal that we have completed a visit to all live objects. - Universe::heap()->next_whole_heap_examined(); } bool ZStatCycle::is_warm() {