Package org.apache.flink.runtime.util
Class Hardware
- java.lang.Object
-
- org.apache.flink.runtime.util.Hardware
-
public class Hardware extends Object
Convenience class to extract hardware specifics of the computer executing the running JVM.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getNumberCPUCores()
Gets the number of CPU cores (hardware contexts) that the JVM has access to.static long
getSizeOfPhysicalMemory()
Returns the size of the physical memory in bytes.
-
-
-
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.
-
-