Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8189497

Improve docker container detection and resource configuration usage



    • CSR
    • Status: Closed
    • P3
    • Resolution: Approved
    • 10
    • hotspot
    • None
    • behavioral
    • low
    • Possible differences in runtime behavior due to changed usage of the operating system facilities.
    • add/remove/modify command line option
    • JDK



      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.


      Container support in Java needs improvement.


      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.


      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.


      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:



        Issue Links



              bobv Bob Vandette (Inactive)
              acorn Karen Kinnear (Inactive)
              Karen Kinnear (Inactive)
              0 Vote for this issue
              6 Start watching this issue