Summary
-------
When available, on Linux default to using the cgroup proc file system to determine CPU and memory configuration information in HotSpot; provide a flag to revert to the previous behavior of using traditional system calls. Add a cross-platform flag to set the active processor count and other supporting flags.
Problem
-------
Container support in Java needs improvement.
Solution
--------
This change adds the following JVM options: -XX:ActiveProcessorCount, -XX:-UseContainerSupport and -Xlog:os+container. It will also deprecate the experimental -XX:+UseCGroupMemoryLimitForHeap option. The -XX:-UseContainerSupport option will disable the new functionality that extracts cpu and memory information from the cgroup file system and revert the behavior back to using Linux system calls for this information. The -XX:ActiveProcessorCount option allows a user to override the number of processors the VM will use when creating threads for various subsystems. This option is available on all currently supported operating systems. The -XX:+UseCGroupMemoryLimitforHeap option is being deprecated with this change since the new cgroup detection logic subsumes this functionality. Finally, this change adds some additional logging (-Xlog:os+container) in order to help determine the decisions that are being made based on the contents of the cgroup file system files.
Specification
-------------
Add the following Hotspot VM command line options.
-XX:-UseContainerSupport (Linux only)
This flag will allow the new container support to be disabled in order to revert to the previous behavior.
-Xlog:os+container=logLevel
The container tag is being added to -Xlog:os in order to allow the VM to report container
information.
-XX:ActiveProcessorCount=xx (Supported on all platforms)
This new flag allows a developer to manually specify how many processors a JVM running in a container (or on a host) will use.
Deprecate the following experimental option in JDK 10 and remove it in JDK 11.
This feature is obsoleted by the new Container support.
-XX:+UseCGroupMemoryLimitForHeap (Linux only)
The full set of changes can be viewed here:
http://cr.openjdk.java.net/~bobv/8146115/webrev.03