Request from Bob :-
Here's some text for the OperatingSystemMXBean work ...
Synopsis: OperatingSystemMXBean should be made Container Aware
The com.sun.management.OperatingSystemMXBean provides information about the operating system that the Java process is running on. If the Java process is running in a docker container, the information returned should be specific to the container but it does not. The data returned is specific to the host operating system and not the container environment.
There is a new internal API that has been added to JDK 11 (jdk.internal.platform.Metrics) that should be used to extract the information being returned by the OperatingSystemMXBean.
If running in a container, the Metrics APIs should be used to return the OperatingSystemMXBean values, otherwise the existing logic should be used.
Bob.