Package org.apache.flink.runtime.util
Class Hardware
java.lang.Object
org.apache.flink.runtime.util.Hardware
Convenience class to extract hardware specifics of the computer executing the running JVM.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intGets the number of CPU cores (hardware contexts) that the JVM has access to.static longReturns the size of the physical memory in bytes.
-
Method Details
-
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.
-