[11u] RFR: 8250627: Use -XX:+/-UseContainerSupport for enabling/disabling Java container metrics

Severin Gehwolf sgehwolf at redhat.com
Thu Jul 30 08:19:04 UTC 2020


Hi,

Could I please get a review of this OpenJDK 11u backport which allows
one to disable Java container metrics via switch
-XX:-UseContainerSupport. Since JDK-8226575 (OperatingSystemMXBean
should be made container aware) is in 11.0.9, I'd like to also backport
the switch which allows one to turn off this container awareness. The
original patch doesn't apply cleanly since there is no cgroupsv2
support in JDK 11u yet. It's cgroupv1 only so far in 11u. Changes can
be trivially resolved.

Changes to the original fix were:
 * Moved the check for -XX:-/+UseContainerSupport flag into
   Metrics.initContainerSubSystems() since that's where the instance is
   created in JDK 11u
 * Adjusted natives accordingly. CgroupMetrics =>
   j.p.i.cgroupv1.Metrics

Bug: https://bugs.openjdk.java.net/browse/JDK-8250627
webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8250627/jdk11/01/webrev/
original-change: https://hg.openjdk.java.net/jdk/jdk/rev/c9ad4de69c32

Testing: new container test, existing container tests and tier1 on Linux x86_64

Thoughts?

Thanks,
Severin



More information about the jdk-updates-dev mailing list