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

XMLWordPrintable

        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

              mbaesken Matthias Baesken
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: