RFR: 8371672: G1: G1YoungGenSizer handling of NewRatio, NewSize and MaxNewSize
Ivan Walulya
iwalulya at openjdk.org
Wed Nov 12 15:17:53 UTC 2025
On Wed, 12 Nov 2025 07:40:01 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> G1YoungGenSizer ignores these values if they are not from the command line. Resulting in a different _sizer_kind than expected.
> The NewSize and MaxNewSize are also not bounded by the Initial and Max heap size respectively ([JDK-8370494](https://bugs.openjdk.org/browse/JDK-8370494)).
>
> I suggest we rewrite this logic using `!FLAG_IS_DEFAULT` to always get the correct behaviour. And only use `FLAG_IS_CMDLINE` for issuing warnings to the user when we ergonomically change or ignore these values to be compatible.
> As well as adding the proper truncation for HeapSize incompatible values.
>
> * Testing
> * GHA
> * Tier 1-5 on Oracle Supported Platforms
Marked as reviewed by iwalulya (Reviewer).
src/hotspot/share/gc/g1/g1YoungGenSizer.cpp line 116:
> 114: _sizer_kind = SizerNewSizeOnly;
> 115: } else {
> 116: assert(user_specified_MaxNewSize, "");
postcond(
-------------
PR Review: https://git.openjdk.org/jdk/pull/28255#pullrequestreview-3453976879
PR Review Comment: https://git.openjdk.org/jdk/pull/28255#discussion_r2518711682
More information about the hotspot-gc-dev
mailing list