[jdk11u-dev] RFR: 8269851: OperatingSystemMXBean getProcessCpuLoad reports incorrect process cpu usage in containers

Severin Gehwolf sgehwolf at openjdk.java.net
Tue Aug 3 16:09:48 UTC 2021


Please review this backport of JDK-8269851 to OpenJDK 11u. That code stream is affected by the same bug and should get fixed in the same way as it got fixed with [JDK-8265836](https://bugs.openjdk.java.net/browse/JDK-8265836) for system CPU load, but for process CPU load.

The patch only differs minimally from the JDK 18 patch, but doesn't apply clean due to the following reason. This version uses `getSystemCpuLoad()` and `getSystemCpuLoad0()` instead of `getCpuLoad()` and `getCpuLoad0()`.

Testing: Manually using the reproducer code from the bug and tier1 on Linux x86_64.

Thoughts?

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

Commit messages:
 - Backport 25f00d787cf56f6cdca6949115d04e7d8e675554

Changes: https://git.openjdk.java.net/jdk11u-dev/pull/183/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=183&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269851
  Stats: 214 lines in 1 file changed: 137 ins; 74 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk11u-dev/pull/183.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk11u-dev pull/183/head:pull/183

PR: https://git.openjdk.java.net/jdk11u-dev/pull/183


More information about the jdk-updates-dev mailing list