Integrated: 8369346: Remove default value of and deprecate the MaxRAM flag
Joel Sikström
jsikstro at openjdk.org
Wed Oct 29 12:50:31 UTC 2025
On Thu, 23 Oct 2025 08:43:25 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
> 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
This pull request has now been integrated.
Changeset: 6964cede
Author: Joel Sikström <jsikstro at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/6964cede0269327d2f13e446e307d531282cdaf9
Stats: 95 lines in 17 files changed: 21 ins; 63 del; 11 mod
8369346: Remove default value of and deprecate the MaxRAM flag
Reviewed-by: ayang, lkorinth
-------------
PR: https://git.openjdk.org/jdk/pull/27952
More information about the hotspot-gc-dev
mailing list