# HG changeset patch # User shade # Date 1571161509 -7200 # Node ID 10db6989907fef8dc3aaf4dbe9f3610df614b95a # Parent 791217cdc433dbac3f67e04e85e0a9cfd2955d9f 8232051: Epsilon should warn about Xms/Xmx/AlwaysPreTouch configuration Reviewed-by: zgu diff -r 791217cdc433 -r 10db6989907f src/hotspot/share/gc/epsilon/epsilonArguments.cpp --- a/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Tue Oct 15 19:38:59 2019 +0200 +++ b/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Tue Oct 15 19:45:09 2019 +0200 @@ -45,13 +45,25 @@ FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true); } + // Warn users that non-resizable heap might be better for some configurations. + // We are not adjusting the heap size by ourselves, because it affects startup time. + if (InitialHeapSize != MaxHeapSize) { + log_warning(gc)("Consider setting -Xms equal to -Xmx to avoid resizing hiccups"); + } + + // Warn users that AlwaysPreTouch might be better for some configurations. + // We are not turning this on by ourselves, because it affects startup time. + if (FLAG_IS_DEFAULT(AlwaysPreTouch) && !AlwaysPreTouch) { + log_warning(gc)("Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups"); + } + if (EpsilonMaxTLABSize < MinTLABSize) { - warning("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize); + log_warning(gc)("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize); EpsilonMaxTLABSize = MinTLABSize; } if (!EpsilonElasticTLAB && EpsilonElasticTLABDecay) { - warning("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled"); + log_warning(gc)("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled"); FLAG_SET_DEFAULT(EpsilonElasticTLABDecay, false); } diff -r 791217cdc433 -r 10db6989907f test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java --- a/test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java Tue Oct 15 19:38:59 2019 +0200 +++ b/test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java Tue Oct 15 19:45:09 2019 +0200 @@ -26,7 +26,12 @@ * @key gc * @requires vm.gc.Epsilon & !vm.graal.enabled * @summary Basic sanity test for Epsilon - * @run main/othervm -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xms128m -Xmx1g -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xms128m -Xmx1g -XX:-AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xms128m -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xmx1g -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xmx1g -XX:-AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch + * @run main/othervm -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch */ package gc.epsilon;