RFR: 8367413: Refactor types in Arguments::set_heap_size() [v4]
Joel Sikström
jsikstro at openjdk.org
Tue Oct 7 09:15:34 UTC 2025
> Hello,
>
> There are several integer types used when setting the heap size ergonomically in `Arguments::set_heap_size()`, such as julong, uint64_t and size_t. It's not clear if this code works as intended on a 32-bit VM with more than 4GB physical memory. There might be issues when converting to/from size_t and uint64_t that we don't handle properly. I suggest we should be more robust and have more control over transitions between potentially smaller types.
>
> Additionally, I've gone ahead and added comments which I think makes it easier to understand what's going on in this function. I've tried my best to leave the existing behavior unchanged, apart from type conversion.
>
> Testing:
> * Oracle's tier1-8 on all Oracle supported platforms
Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
Revert MaxRAM default removals, defer to future enhancement
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27224/files
- new: https://git.openjdk.org/jdk/pull/27224/files/bd1f632e..2304c6aa
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27224&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27224&range=02-03
Stats: 17 lines in 2 files changed: 17 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/27224.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27224/head:pull/27224
PR: https://git.openjdk.org/jdk/pull/27224
More information about the hotspot-gc-dev
mailing list