8292541: [Metrics] Reported memory limit may exceed physical machine memory#10017
8292541: [Metrics] Reported memory limit may exceed physical machine memory#10017jmtd wants to merge 10 commits intoopenjdk:masterfrom
Conversation
One test for OperatingSystemMXBean and another for -XshowSettings:system, which exercises the Metrics sub-system. extend TestMemoryAwareness to cover OperatingSystemMXBean with bad cgroup memory limit add testMetricsIgnoresMemLimitExceedingPhysicalMemory and refactor Pull the code that establishes host physical max RAM out into a helper function.
Detect when the subsystem limit exceeds physical RAM and treat that situation as "unlimited". Add a private native method to establish physical RAM size. This presently is only likely to work on POSIX systems, but CgroupMetrics are Linux-specific. None the less the precise guards etc. may need adjusting.
|
👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into |
Webrevs
|
src/java.base/linux/classes/jdk/internal/platform/CgroupMetrics.java
Outdated
Show resolved
Hide resolved
Thanks Thomas Stuefe
src/java.base/linux/classes/jdk/internal/platform/CgroupMetrics.java
Outdated
Show resolved
Hide resolved
src/java.base/linux/classes/jdk/internal/platform/CgroupMetrics.java
Outdated
Show resolved
Hide resolved
src/java.base/linux/classes/jdk/internal/platform/CgroupMetrics.java
Outdated
Show resolved
Hide resolved
|
@jmtd This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@tstuefe, @jerboaa) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
This is relied upon for tests in test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java
|
/integrate |
jerboaa
left a comment
There was a problem hiding this comment.
Sorry, but this last change is a hack.
For 8292541, I wrote two further tests that used the same technique as testContainerMemExceedsPhysical to establish baseline physical RAM. Rework testContainerMemExceedsPhysical to use the shared variable hostMaxMem rather than recalculate the value itself.
|
Now that #9880 has been merged the hack is gone and the tests can match against the log lines to establish base line physical RAM. There are three tests that use this now. In cc8fdf3 for this PR I've adjusted the first test (merged already) to share the established baseline physical RAM value rather than calculate it again. @jerboaa WDYT now? And thanks for all your support! |
|
/integrate |
|
/sponsor |
|
Going to push as commit 9a0d1e7.
Your commit was automatically rebased without conflicts. |
When the container memory exceeds the physical host's memory, the Java metrics reporting is wrong.
https://bugs.openjdk.org/browse/JDK-8292541
This is the equivalent core-libs fix for Hotspot's JDK-8292083
(#9880)
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10017/head:pull/10017$ git checkout pull/10017Update a local copy of the PR:
$ git checkout pull/10017$ git pull https://git.openjdk.org/jdk pull/10017/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10017View PR using the GUI difftool:
$ git pr show -t 10017Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10017.diff