RFR: 8378319: Obsolete the MaxRAM flag [v3]

Joel Sikström jsikstro at openjdk.org
Mon Feb 23 14:21:47 UTC 2026


> Hello,
> 
> This PR obsoletes the MaxRAM flag after being deprecated in JDK26. Removing the flag from the arguments-parsing code is straightforward, but is more complicated in the documentation and several tests using the flag.
> 
> For the documentation I've opted to use the term "available memory to the JVM process" consistently instead, which I've repurposed from the now removed description of the MaxRAM flag.
> 
> There are several tests using the MaxRAM flag because of its type (uint64_t). For those tests I've replaced it with either `ErrorLogTimeout` or `StringDeduplicationHashSeed`. Since we don't have any "unlimited/unbound" product uint64_t flags, I've used `StringDeduplicationHashSeed` for places requiring an "unlimited/unbound" flag, and made sure that `-XX:+UnlockDiagnosticVMOptions` is present.
> 
> There are three jtreg tests that have been using MaxRAM to "simulate" being on a machine with more RAM than might be available and I've had to come up with a new approach for all three.
> 
> test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java (renamed to TestMaxRAMPercentage.java)
> test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java
> test/hotspot/jtreg/gc/g1/TestRegionAlignment.java
> 
> 
> Perhaps the most controversial change is for TestMaxRAMPercentage.java (renamed from testMaxRAMFlags.java), which is only run for machines with more RAM than the required maxcoopheapsize + a bit of headroom, so we can test all scenarios.
> 
> Testing:
> * I've run all tests that I've changed locally in both release and fastdebug on Mac+Linux.
> * Oracle's tier1-4

Joel Sikström has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:

 - Merge branch 'master' into JDK-8378319_obsolete_maxram
 - Merge branch 'master' into JDK-8378319_obsolete_maxram
 - Rename phys_mem to avail_mem
 - Simplify TestMaxRAMPercentage.java
 - 8378319: Obsolete the MaxRAM flag

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

Changes: https://git.openjdk.org/jdk/pull/29838/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29838&range=02
  Stats: 343 lines in 11 files changed: 148 ins; 163 del; 32 mod
  Patch: https://git.openjdk.org/jdk/pull/29838.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29838/head:pull/29838

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


More information about the hotspot-dev mailing list