Need to have a function which returns the max heap size (ie what is set by -Xmx). This might be in class Runtime and look like:
public long maxMemory();
We alse need a function returning the number of processors on the underlying hardware. This could again be in class Runtime and look like:
public int processorCount();
public long maxMemory();
We alse need a function returning the number of processors on the underlying hardware. This could again be in class Runtime and look like:
public int processorCount();
- duplicates
-
JDK-4481913 RFE: Java needs a way to determine the number of processors in an SMP machine
-
- Closed
-
-
JDK-4420145 Support to detect maximum heap size specified at command-line
-
- Closed
-
- relates to
-
JDK-4896490 (spec) No @since in java.lang.Runtime.maxMemory()/availableProcessors()
-
- Resolved
-