RFR: 8350596: [Linux] Increase default MaxRAMPercentage for containerized workloads

Severin Gehwolf sgehwolf at openjdk.org
Wed May 7 09:35:29 UTC 2025


Please take a look at this proposal to fix the "Java needs so much memory" perception in containers. The idea would be to bump the default `MaxRAMPercentage` to a higher value. The patch proposes 75%, but we could just as well use 50% if people feel more comfortable about it. Right now the default deployment in containers with resource limits in place (common for Kubernetes deployments) where a single process runs in the container isn't well catered for today for an application that just uses the default configuration. Only 25% of the container memory will be used for the Java heap, arguably wasting much of the remaining memory that has been granted to the container by a memory limit (that the JVM would detect and use as physical memory).

I've filed a CSR for this as well for which I'm looking for reviewers too and intend to write a release note as well about this change as it has some risk associated with it, although the escape hatch is pretty simple: set `-XX:MaxRAMPercentage=25.0` to go back to the old behavour.

Testing:
- [x] GHA - tier 1 (windows failures seem infra related)
- [x] hotspot and jdk container tests on cg v2 and cg v1 including the two new tests.

Thoughts? Opinions?

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

Commit messages:
 - 8350596: [Linux] Increase default MaxRAMPercentage for containerized workloads

Changes: https://git.openjdk.org/jdk/pull/25086/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25086&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350596
  Stats: 170 lines in 5 files changed: 170 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/25086.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25086/head:pull/25086

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


More information about the hotspot-runtime-dev mailing list