src/os/solaris/vm/os_solaris.cpp
Print this page
@@ -357,10 +357,20 @@
_processors_online = sysconf (_SC_NPROCESSORS_ONLN);
_physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE);
}
int os::active_processor_count() {
+ // User has overridden the number of active processors
+ if (ActiveProcessorCount > 0) {
+ if (Verbose) {
+ tty->print_cr("active_processor_count: "
+ "active processor count set by user : %d",
+ ActiveProcessorCount);
+ }
+ return ActiveProcessorCount;
+ }
+
int online_cpus = sysconf(_SC_NPROCESSORS_ONLN);
pid_t pid = getpid();
psetid_t pset = PS_NONE;
// Are we running in a processor set or is there any processor set around?
if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) {