Skip to content

8350596: [Linux] Increase default MaxRAMPercentage for containerized workloads #25086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jerboaa
Copy link
Contributor

@jerboaa jerboaa commented May 7, 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:

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

Thoughts? Opinions?


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8356194 to be approved

Issues

  • JDK-8350596: [Linux] Increase default MaxRAMPercentage for containerized workloads (Enhancement - P3)
  • JDK-8356194: [Linux] Increase default MaxRAMPercentage for containerized workloads (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25086/head:pull/25086
$ git checkout pull/25086

Update a local copy of the PR:
$ git checkout pull/25086
$ git pull https://git.openjdk.org/jdk.git pull/25086/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25086

View PR using the GUI difftool:
$ git pr show -t 25086

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25086.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 7, 2025

👋 Welcome back sgehwolf! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@jerboaa
Copy link
Contributor Author

jerboaa commented May 7, 2025

/label add hospot-gc-dev

@jerboaa
Copy link
Contributor Author

jerboaa commented May 7, 2025

/csr needed

@openjdk
Copy link

openjdk bot commented May 7, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels May 7, 2025
@openjdk
Copy link

openjdk bot commented May 7, 2025

@jerboaa
The label hospot-gc is not a valid label.
These labels are valid:

  • graal
  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk
Copy link

openjdk bot commented May 7, 2025

@jerboaa an approved CSR request is already required for this pull request.

@openjdk
Copy link

openjdk bot commented May 7, 2025

@jerboaa The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented May 7, 2025

Webrevs

@jerboaa
Copy link
Contributor Author

jerboaa commented May 7, 2025

/label add hotspot-gc

@openjdk
Copy link

openjdk bot commented May 7, 2025

@jerboaa
The hotspot-gc label was successfully added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csr Pull request needs approved CSR before integration hotspot-gc [email protected] hotspot-runtime [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant