278 char buf[1024];
279 ResourceMark rm;
280 outputStream* log = Log(os, cpu)::info_stream();
281 os::print_cpu_info(log, buf, sizeof(buf));
282 }
283 }
284
285 unsigned int Abstract_VM_Version::nof_parallel_worker_threads(
286 unsigned int num,
287 unsigned int den,
288 unsigned int switch_pt) {
289 if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
290 assert(ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
291 unsigned int threads;
292 // For very large machines, there are diminishing returns
293 // for large numbers of worker threads. Instead of
294 // hogging the whole system, use a fraction of the workers for every
295 // processor after the first 8. For example, on a 72 cpu machine
296 // and a chosen fraction of 5/8
297 // use 8 + (72 - 8) * (5/8) == 48 worker threads.
298 unsigned int ncpus = (unsigned int) os::active_processor_count();
299 threads = (ncpus <= switch_pt) ?
300 ncpus :
301 (switch_pt + ((ncpus - switch_pt) * num) / den);
302 #ifndef _LP64
303 // On 32-bit binaries the virtual address space available to the JVM
304 // is usually limited to 2-3 GB (depends on the platform).
305 // Do not use up address space with too many threads (stacks and per-thread
306 // data). Note that x86 apps running on Win64 have 2 stacks per thread.
307 // GC may more generally scale down threads by max heap size (etc), but the
308 // consequences of over-provisioning threads are higher on 32-bit JVMS,
309 // so add hard limit here:
310 threads = MIN2(threads, (2*switch_pt));
311 #endif
312 return threads;
313 } else {
314 return ParallelGCThreads;
315 }
316 }
317
318 unsigned int Abstract_VM_Version::calc_parallel_worker_threads() {
|
278 char buf[1024];
279 ResourceMark rm;
280 outputStream* log = Log(os, cpu)::info_stream();
281 os::print_cpu_info(log, buf, sizeof(buf));
282 }
283 }
284
285 unsigned int Abstract_VM_Version::nof_parallel_worker_threads(
286 unsigned int num,
287 unsigned int den,
288 unsigned int switch_pt) {
289 if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
290 assert(ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
291 unsigned int threads;
292 // For very large machines, there are diminishing returns
293 // for large numbers of worker threads. Instead of
294 // hogging the whole system, use a fraction of the workers for every
295 // processor after the first 8. For example, on a 72 cpu machine
296 // and a chosen fraction of 5/8
297 // use 8 + (72 - 8) * (5/8) == 48 worker threads.
298 unsigned int ncpus = (unsigned int) os::initial_active_processor_count();
299 threads = (ncpus <= switch_pt) ?
300 ncpus :
301 (switch_pt + ((ncpus - switch_pt) * num) / den);
302 #ifndef _LP64
303 // On 32-bit binaries the virtual address space available to the JVM
304 // is usually limited to 2-3 GB (depends on the platform).
305 // Do not use up address space with too many threads (stacks and per-thread
306 // data). Note that x86 apps running on Win64 have 2 stacks per thread.
307 // GC may more generally scale down threads by max heap size (etc), but the
308 // consequences of over-provisioning threads are higher on 32-bit JVMS,
309 // so add hard limit here:
310 threads = MIN2(threads, (2*switch_pt));
311 #endif
312 return threads;
313 } else {
314 return ParallelGCThreads;
315 }
316 }
317
318 unsigned int Abstract_VM_Version::calc_parallel_worker_threads() {
|