On 1/17/20 5:31 AM, Severin Gehwolf wrote:
If I understand you correctly, then we'd have to change how -XshowSettings:system works currently with it. Not all metrics as currently printed via LauncherHelper.java are supported in both worlds (cgroup v1 & v2). It would make handling of cgroup v1 and cgroup v2 specific metrics a little more awkward. Adding instanceof checks and downcasting as you suggest the consequence for a client would be. See: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8231111/08/webrev/src/java.base/share/classes/sun/launcher/LauncherHelper.java.sdiff.html Also, in order to not break cross platform promises we'd also have to make the version specific interfaces available in shared code (or we'd risk requiring the user to use reflection) to get the proper sub- interface logic called.
-XshowSettings:system output is implementation detail [1] and also linux-only option. jdk.internal.platform.Metrics is an internal API and there is no promise that it supports the union of all cgroups v1 and v2 metrics. As you see, 1/3 of the metrics in v1 are not supported in v2. It's reasonable for -XshowSettings:system showing the metrics valid to the container.
thanks Mandy [1] https://bugs.openjdk.java.net/browse/JDK-8204107