I'm running a Java 1.6 process on an 8-node NUMA machine using:
numactl --cpunodebind=0 java -server com.foo.Bar
Each node has 8 CPUs as reported by numactl --hardware
:
available: 8 nodes (0-7)
node 0 cpus: 1 2 3 4 5 6 7 8
node 0 size: ...
node 0 free: ...
node 1 cpus: 9 10 11 12 13 14 15 16
node 1 size: ...
node 1 free: ...
...
node 7 cpus: 56 57 58 59 60 61 62 63
node 7 size: ...
node 7 free: ...
The function call Runtime.getRuntime().availableProcessors()
returns 64
.
Why does the Runtime
object for the process report 64 available processors, despite the cpunodebind
restriction? Is there a way to get the actual number of processors available to the Java process?