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

getAvailableProcessors may incorrectly report the number of cpus in Docker container

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8, 9
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:

      Description

      OperatingSystemMXBean.getAvailableProcessors should return the number of processors made available to the process. Docker can place limits on it.
      Mis-reporting the number can throw off heuristics for optimizing computations based on memory size and available processors.
      It is hinted that the number of processors reported from /proc on linux reports the hardware processors not those permitted to the process.

      sysconf(_SC_NPROCESSORS_CONF) may be more reliable in this case.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rriggs Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: