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

Improve docker container detection and resource configuration usage

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Possible differences in runtime behavior due to changed usage of the operating system facilities.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bobv Bob Vandette
                Reporter:
                acorn Karen Kinnear (Inactive)
                Reviewed By:
                Karen Kinnear (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: