RFR: 8347256: Epsilon: Demote heap size and AlwaysPreTouch warnings to info level

Aleksey Shipilev shade at openjdk.org
Thu Jan 9 10:05:40 UTC 2025


On Wed, 8 Jan 2025 15:50:28 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> 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
>
> lgtm.

Thank you @tschatzl! I think I need another Review to merge this. Thanks!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22965#issuecomment-2579655476


More information about the hotspot-gc-dev mailing list