RFR: Compact heuristics adjustments
Aleksey Shipilev
shade at redhat.com
Thu Nov 15 16:12:17 UTC 2018
I want to do a few "compact" heuristics adjustments after my yesterday's experiments with it: more
aggressive uncommit, denser compaction, reacting on minimum free threshold it case allocation
threshold is too high.
diff -r 509403d31498 src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp Thu Nov 15
11:12:27 2018 +0100
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp Thu Nov 15
17:10:24 2018 +0100
@@ -35,20 +35,27 @@
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahUncommit);
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahAlwaysClearSoftRefs);
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahAllocationThreshold, 10);
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahImmediateThreshold, 100);
- SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUncommitDelay, 5000);
+ SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUncommitDelay, 1000);
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahGuaranteedGCInterval, 30000);
- SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahGarbageThreshold, 20);
+ SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahGarbageThreshold, 10);
}
bool ShenandoahCompactHeuristics::should_start_normal_gc() const {
ShenandoahHeap* heap = ShenandoahHeap::heap();
size_t available = heap->free_set()->available();
size_t threshold_bytes_allocated = heap->capacity() * ShenandoahAllocationThreshold / 100;
+ size_t min_threshold = ShenandoahMinFreeThreshold * heap->capacity() / 100;
+
+ if (available < min_threshold) {
+ log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
+ available / M, min_threshold / M);
+ return true;
+ }
if (available < threshold_bytes_allocated) {
log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is lower than allocated recently (" SIZE_FORMAT
"M)",
available / M, threshold_bytes_allocated / M);
return true;
Testing: tier3_gc_shenandoah
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list