RFR: 8347256: Epsilon: Demote heap size and AlwaysPreTouch warnings to info level
Aleksey Shipilev
shade at openjdk.org
Wed Jan 8 11:03:17 UTC 2025
For Epsilon, we have added `log_warning` messages when heap size and AlwaysPreTouch configuration is not great with [JDK-8232051](https://bugs.openjdk.org/browse/JDK-8232051). Unfortunately, this means we print this warning all the time, even though users might not actually run into problems there, or when users tried to implement these suggestions and still decided to run against them.
I think we want to emit the suggestions in the normal GC log instead, so they are not printed all the time. Additionally, I moved the printing at the end of init logger, so it does not come in the middle of `gc,init` block.
Output before:
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC Hello.java
[0.008s][warning][gc,init] Consider setting -Xms equal to -Xmx to avoid resizing hiccups
[0.008s][warning][gc,init] Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups
Hello!
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc Hello.java
[0.008s][info][gc] Using Epsilon
[0.008s][warning][gc,init] Consider setting -Xms equal to -Xmx to avoid resizing hiccups
[0.008s][warning][gc,init] Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups
Hello!
[0.757s][info ][gc ] Heap: 1024M reserved, 129M (12.60%) committed, 23906K (2.28%) used
Output after:
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC Hello.java
Hello!
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc Hello.java
[0.009s][info][gc] Using Epsilon
[0.009s][info][gc] Consider setting -Xms equal to -Xmx to avoid resizing hiccups
[0.009s][info][gc] Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups
Hello!
[0.753s][info][gc] Heap: 1024M reserved, 129M (12.60%) committed, 23908K (2.28%) used
-------------
Commit messages:
- Leave it in epsilonInitLogger
- Fix
Changes: https://git.openjdk.org/jdk/pull/22965/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22965&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8347256
Stats: 24 lines in 1 file changed: 12 ins; 12 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/22965.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22965/head:pull/22965
PR: https://git.openjdk.org/jdk/pull/22965
More information about the hotspot-gc-dev
mailing list