Class RuntimeUtils


public final class RuntimeUtils extends Object
Runtime utilities that enhance behavior of java.lang.Runtime.
  • Method Details

    • getAvailableProcessors

      public static int getAvailableProcessors()
      Faster way to get the number of processors in the system.

      The call the Runtime.availableProcessors is prohibitively slow (at least in Java 1.6 on Debian 6). The number of processors in a system is unlikely to change frequently. This will only call Runtime.availableProcessors once a second.