RFR: 8369346: Remove default value of and deprecate the MaxRAM flag

Joel Sikström jsikstro at openjdk.org
Thu Oct 23 08:53:25 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

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

Commit messages:
 - 8369346: Remove default value of and deprecate the MaxRAM flag

Changes: https://git.openjdk.org/jdk/pull/27952/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27952&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8369346
  Stats: 59 lines in 17 files changed: 2 ins; 44 del; 13 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