Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8230305 Cgroups v2: Container awareness
  3. JDK-8231111

Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u231, 11.0.5, 13.0.1, 14
    • Fix Version/s: 15
    • Component/s: core-libs
    • Resolved In Build:
      b11
    • CPU:
      generic
    • OS:
      linux

      Description

      Currently, the Linux-only Metrics class in jdk/internal/platform/Metrics.java hard-codes cgroups version 1:

          /**
           * Returns an instance of the Metrics class.
           *
           * @return Metrics object or null if not supported on this platform.
           */
          public static Metrics systemMetrics() {
              try {
                  // We currently only support cgroupv1
                  Class<?> c = Class.forName("jdk.internal.platform.cgroupv1.Metrics");
              [...]
           }

      For the cgroups v2 effort this needs to be reworked.

      On a F31 system with unified hierarchy only, java -XshowSettings:system look like this:

      $ bin/java -XshowSettings:system -version
      Operating System Metrics:
          No metrics available for this platform
      openjdk version "14-internal" 2020-03-17
      OpenJDK Runtime Environment (fastdebug build 14-internal+0-adhoc.sgehwolf.jdk-jdk)
      OpenJDK 64-Bit Server VM (fastdebug build 14-internal+0-adhoc.sgehwolf.jdk-jdk, mixed mode, sharing)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sgehwolf Severin Gehwolf
                Reporter:
                sgehwolf Severin Gehwolf
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: