Skip to content

Commit 6b11446

Browse files
committedOct 15, 2019
8232051: Epsilon should warn about Xms/Xmx/AlwaysPreTouch configuration
Reviewed-by: zgu
1 parent c1972ec commit 6b11446

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
 

‎src/hotspot/share/gc/epsilon/epsilonArguments.cpp

+14-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,25 @@ void EpsilonArguments::initialize() {
4545
FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true);
4646
}
4747

48+
// Warn users that non-resizable heap might be better for some configurations.
49+
// We are not adjusting the heap size by ourselves, because it affects startup time.
50+
if (InitialHeapSize != MaxHeapSize) {
51+
log_warning(gc)("Consider setting -Xms equal to -Xmx to avoid resizing hiccups");
52+
}
53+
54+
// Warn users that AlwaysPreTouch might be better for some configurations.
55+
// We are not turning this on by ourselves, because it affects startup time.
56+
if (FLAG_IS_DEFAULT(AlwaysPreTouch) && !AlwaysPreTouch) {
57+
log_warning(gc)("Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups");
58+
}
59+
4860
if (EpsilonMaxTLABSize < MinTLABSize) {
49-
warning("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);
61+
log_warning(gc)("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);
5062
EpsilonMaxTLABSize = MinTLABSize;
5163
}
5264

5365
if (!EpsilonElasticTLAB && EpsilonElasticTLABDecay) {
54-
warning("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled");
66+
log_warning(gc)("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled");
5567
FLAG_SET_DEFAULT(EpsilonElasticTLABDecay, false);
5668
}
5769

‎test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
* @key gc
2727
* @requires vm.gc.Epsilon & !vm.graal.enabled
2828
* @summary Basic sanity test for Epsilon
29-
* @run main/othervm -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
29+
* @run main/othervm -Xms128m -Xmx1g -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
30+
* @run main/othervm -Xms128m -Xmx1g -XX:-AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
31+
* @run main/othervm -Xms128m -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
32+
* @run main/othervm -Xmx1g -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
33+
* @run main/othervm -Xmx1g -XX:-AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
34+
* @run main/othervm -Xmx1g -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC gc.epsilon.TestAlwaysPretouch
3035
*/
3136

3237
package gc.epsilon;

0 commit comments

Comments
 (0)
Please sign in to comment.