public class ProcessorInfo
extends java.lang.Object
Constructor and Description |
---|
ProcessorInfo() |
Modifier and Type | Method and Description |
---|---|
static int |
availableProcessors()
Returns the number of processors available to this process.
|
public static int availableProcessors()
Runtime.availableProcessors()
. However, on Linux, this strategy
is insufficient, since the JVM does not take into consideration the process' CPU set affinity
which is employed by cgroups and numactl. Therefore this method will analyze the Linux proc filesystem
to make the determination. Since the CPU affinity of a process can be change at any time, this method does
not cache the result. Calls should be limited accordingly.
Copyright © 2015 JBoss, a division of Red Hat, Inc.