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

API for obtaining low-level CPU information (e.g., socket count and CPU model)

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 1.4.2_06, 6u22
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000, windows_xp

      Description

      The following code when run on Windows platform, normally returns the correct
      results. But when we use the intel's hyperthreading then it returns twice the
      number of processors available.

      The reason is that java.lang.Runtime.availableProcessors() is returning the
      number of logical processors, rather than the physical ones.

      import java.lang.Runtime.*;

      public class FindProcessor
      {
          public static void main(String argv[]) {
      Runtime rt = java.lang.Runtime.getRuntime();
      System.out.println("The available processors are " +
                  rt.availableProcessors());

          }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: