JDK-8369346 : Remove default value of and deprecate the MaxRAM flag
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-10-08
  • Updated: 2025-11-03
  • Resolved: 2025-10-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b22Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
The value of the MaxRAM flag is used when setting the heap size ergonomically when the user has not explicitly specified at least one of `-Xmx` (equivalent to `-XX:MaxHeapSize`), `-Xms`, `-XX:MinHeapSize` or `-XX:InitialHeapSize`.

If the user has not configured MaxRAM, MaxRAMPercentage, MinRAMPercentage or InitialRAMPercentage, ergonomic heap sizing will use the minimum of the reported physical memory by the OS and MaxRAM. If MaxRAM is not configured, but any of MaxRAMPercentage, MinRAMPercentage or InitialRAMPercentage are, then ergonomic heap sizing will use the reported physical memory by the OS. If MaxRAM is configured, ergonomic heap sizing will use that value.

The behavior of ignoring the default value of MaxRAM when any of MaxRAMPercentage, MinRAMPercentage or InitialRAMPercentage are explicitly set was added as a way to get around the default value of 128GB of MaxRAM. This raises the question if having a default value for MaxRAM is really necessary. Furthermore, we've seen that the seemingly arbitrary value of 128GB is unintuitive for users in the community.

Explicit configuration of MaxRAM is rarely necessary, as the JVM can accurately detect physical memory and consider commit limits. Also, setting MaxRAM above physical memory could lead to misconfiguration or incorrect sizing and, to our knowledge, is not a common use case. There might be niche scenarios, such as simulating heap sizing decisions for systems with more memory, which can typically be handled through other means in development or testing environments instead. Thus, keeping a default MaxRAM value offers little benefit and adds unnecessary complexity. To simplify ergonomic heap sizing and reduce confusion, the MaxRAM flag itself should be deprecated. Users who need to control the heap size directly are encouraged to use standard, well-supported flags such as `-Xmx` and `-Xms` instead.
Comments
Changeset: 6964cede Branch: master Author: Joel Sikström <jsikstro@openjdk.org> Date: 2025-10-29 12:47:18 +0000 URL: https://git.openjdk.org/jdk/commit/6964cede0269327d2f13e446e307d531282cdaf9
29-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27952 Date: 2025-10-23 08:43:25 +0000
23-10-2025