RFR: 8378319: Obsolete the MaxRAM flag [v2]
Thomas Schatzl
tschatzl at openjdk.org
Mon Feb 23 08:54:10 UTC 2026
On Fri, 20 Feb 2026 15:52:01 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
>> 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 four commits:
>
> - Merge branch 'master' into JDK-8378319_obsolete_maxram
> - Rename phys_mem to avail_mem
> - Simplify TestMaxRAMPercentage.java
> - 8378319: Obsolete the MaxRAM flag
Seems good.
-------------
Marked as reviewed by tschatzl (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29838#pullrequestreview-3839796949
More information about the hotspot-dev
mailing list