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

Joel Sikström jsikstro at openjdk.org
Wed Oct 29 10:03:53 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' into JDK-8369346_remove_default_maxram
 - Move MaxRAM to deprecated section in java.md
 - 8369346: Remove default value of and deprecate the MaxRAM flag

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27952/files
  - new: https://git.openjdk.org/jdk/pull/27952/files/03188828..905554ab

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

  Stats: 11449 lines in 335 files changed: 6388 ins; 3777 del; 1284 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