8134889: Kitchensink stress test crashes with out of memory error
Add a hard max of 16 GC threads (each for concurrent and parallel G1) on 32-bit JVMs. Reviewed-by: mgerdin, pliden
This commit is contained in:
parent
7933c418de
commit
46d52062aa
@ -289,6 +289,7 @@ unsigned int Abstract_VM_Version::nof_parallel_worker_threads(
|
|||||||
unsigned int switch_pt) {
|
unsigned int switch_pt) {
|
||||||
if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
|
if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
|
||||||
assert(ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
|
assert(ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
|
||||||
|
unsigned int threads;
|
||||||
// For very large machines, there are diminishing returns
|
// For very large machines, there are diminishing returns
|
||||||
// for large numbers of worker threads. Instead of
|
// for large numbers of worker threads. Instead of
|
||||||
// hogging the whole system, use a fraction of the workers for every
|
// hogging the whole system, use a fraction of the workers for every
|
||||||
@ -296,9 +297,20 @@ unsigned int Abstract_VM_Version::nof_parallel_worker_threads(
|
|||||||
// and a chosen fraction of 5/8
|
// and a chosen fraction of 5/8
|
||||||
// use 8 + (72 - 8) * (5/8) == 48 worker threads.
|
// use 8 + (72 - 8) * (5/8) == 48 worker threads.
|
||||||
unsigned int ncpus = (unsigned int) os::active_processor_count();
|
unsigned int ncpus = (unsigned int) os::active_processor_count();
|
||||||
return (ncpus <= switch_pt) ?
|
threads = (ncpus <= switch_pt) ?
|
||||||
ncpus :
|
ncpus :
|
||||||
(switch_pt + ((ncpus - switch_pt) * num) / den);
|
(switch_pt + ((ncpus - switch_pt) * num) / den);
|
||||||
|
#ifndef _LP64
|
||||||
|
// On 32-bit binaries the virtual address space available to the JVM
|
||||||
|
// is usually limited to 2-3 GB (depends on the platform).
|
||||||
|
// Do not use up address space with too many threads (stacks and per-thread
|
||||||
|
// data). Note that x86 apps running on Win64 have 2 stacks per thread.
|
||||||
|
// GC may more generally scale down threads by max heap size (etc), but the
|
||||||
|
// consequences of over-provisioning threads are higher on 32-bit JVMS,
|
||||||
|
// so add hard limit here:
|
||||||
|
threads = MIN2(threads, (2*switch_pt));
|
||||||
|
#endif
|
||||||
|
return threads;
|
||||||
} else {
|
} else {
|
||||||
return ParallelGCThreads;
|
return ParallelGCThreads;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user