RFR: Explicit GC should actually uncommit the heap

Aleksey Shipilev shade at redhat.com
Sun Aug 5 21:08:08 UTC 2018


Made this simple mistake during refactoring. Explicit GC should enter this block to actually reach
service_uncommit:

diff -r c81906c39221 src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp       Fri Aug 03 19:45:29 2018 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp       Sun Aug 05 23:07:36 2018 +0200
@@ -218,17 +218,17 @@
     double current = os::elapsedTime();

-    if (ShenandoahUncommit && (current - last_shrink_time > shrink_period)) {
+    if (ShenandoahUncommit && (explicit_gc_requested || (current - last_shrink_time >
shrink_period))) {
       // Try to uncommit enough stale regions. Explicit GC tries to uncommit everything.
       // Regular paths uncommit only occasionally.
       double shrink_before = explicit_gc_requested ?
                              current :
                              current - (ShenandoahUncommitDelay / 1000.0);
       service_uncommit(shrink_before);
       last_shrink_time = current;
     }


Testing: tier3_gc_shenandoah, ad-hoc tests

Thanks,
-Aleksey


More information about the shenandoah-dev mailing list