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

getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 16
    • Component/s: core-svc
    • Labels:
      None

      Description

      On one of our Linux machines we have the following :
      - a few CPUs are offline (means the configured cpus are 48 but the online cpus are 32)
      - the machine does not have cpusets.effective_cpus

      In this case getSystemCpuLoad() / getCpuLoad() returns -1 (because it checks that 48 != 32, and next it checks for cpusets.effective_cpus which is not present ).

      See the coding at :
      https://hg.openjdk.java.net/jdk/jdk/file/bdc14b8d31ff/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java#l136

        Attachments

          Activity

            People

            • Assignee:
              mbaesken Matthias Baesken
              Reporter:
              mbaesken Matthias Baesken
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: