RFR: 8371672: G1: G1YoungGenSizer handling of NewRatio, NewSize and MaxNewSize [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Nov 13 06:22:38 UTC 2025


> 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

Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:

  Apply @walulyai suggestion

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28255/files
  - new: https://git.openjdk.org/jdk/pull/28255/files/91b86362..afba48e6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28255&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28255&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28255.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28255/head:pull/28255

PR: https://git.openjdk.org/jdk/pull/28255


More information about the hotspot-gc-dev mailing list