8232051: Epsilon should warn about Xms/Xmx/AlwaysPreTouch configuration

Reviewed-by: zgu
This commit is contained in:
Aleksey Shipilev 2019-10-15 19:45:09 +02:00
parent c1972ecd19
commit 6b11446797
2 changed files with 20 additions and 3 deletions
src/hotspot/share/gc/epsilon
test/hotspot/jtreg/gc/epsilon

@ -45,13 +45,25 @@ void EpsilonArguments::initialize() {
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);
}

@ -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;