Java进程报告“不正确”的可用处理器数量

时间:2014-03-03 23:45:40

标签: java linux runtime numa numactl

我使用以下命令在8节点NUMA计算机上运行Java 1.6进程:

numactl --cpunodebind=0 java -server com.foo.Bar

numactl --hardware报告的每个节点有8个CPU:

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: ...

函数调用Runtime.getRuntime().availableProcessors()返回64

为什么流程的Runtime对象报告64个可用的处理器,尽管有cpunodebind限制?有没有办法获得Java进程可用的实际处理器数量?

0 个答案:

没有答案