RFR: 8369346: Remove default value of and deprecate the MaxRAM flag [v2]
Joel Sikström
jsikstro at openjdk.org
Thu Oct 23 09:04:21 UTC 2025
> Hello,
>
> Please see the CSR for a more detailed explanation and specific information regarding the deprecation of the flag. To summarize, the JVM is well-equiped to detect system memory and handle potential truncation errors (see [JDK-8367413 ](https://bugs.openjdk.org/browse/JDK-8367413)), making MaxRAM largely redundant. Removing the default value from MaxRAM mainly impacts systems with more memory than the default (128GB on 64-bit systems and 4GB on 32-bit systems) that are running with `-XX:-UseCompressedOops` or `-XX:+UseZGC`, which disable compressed oops. We recommend users to use well-supported flags such as `-Xms` and `-Xmx` to influence heap sizing instead.
>
> MaxRAM is used to a very small extent to influence memory allocation in JDK tests, where MaxRAMPercentage is much more common. When MaxRAM is eventually obsoleted, the few affected tests will need to be updated or use alternative flags.
>
> Testing:
> * Oracle's tier1-8
Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
Move MaxRAM to deprecated section in java.md
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27952/files
- new: https://git.openjdk.org/jdk/pull/27952/files/c9b672f6..03188828
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27952&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27952&range=00-01
Stats: 38 lines in 1 file changed: 19 ins; 19 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/27952.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27952/head:pull/27952
PR: https://git.openjdk.org/jdk/pull/27952
More information about the hotspot-gc-dev
mailing list