Class Hardware


  • public class Hardware
    extends Object
    Convenience class to extract hardware specifics of the computer executing the running JVM.
    • Method Detail

      • getNumberCPUCores

        public static int getNumberCPUCores()
        Gets the number of CPU cores (hardware contexts) that the JVM has access to.
        Returns:
        The number of CPU cores.
      • getSizeOfPhysicalMemory

        public static long getSizeOfPhysicalMemory()
        Returns the size of the physical memory in bytes.
        Returns:
        the size of the physical memory in bytes or -1, if the size could not be determined.