mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8150839: Adjust the number of compiler threads for 32-bit platforms
Set the number of compiler threads to 3 on 32-bit platforms. Reviewed-by: iveresov
This commit is contained in:
parent
40fe96de0d
commit
d30d687178
3 changed files with 22 additions and 1 deletions
|
@ -42,17 +42,30 @@ void AdvancedThresholdPolicy::print_specific(EventType type, methodHandle mh, me
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvancedThresholdPolicy::initialize() {
|
void AdvancedThresholdPolicy::initialize() {
|
||||||
|
int count = CICompilerCount;
|
||||||
|
#ifdef _LP64
|
||||||
// Turn on ergonomic compiler count selection
|
// Turn on ergonomic compiler count selection
|
||||||
if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) {
|
if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) {
|
||||||
FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
|
FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
|
||||||
}
|
}
|
||||||
int count = CICompilerCount;
|
|
||||||
if (CICompilerCountPerCPU) {
|
if (CICompilerCountPerCPU) {
|
||||||
// Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
|
// Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
|
||||||
int log_cpu = log2_intptr(os::active_processor_count());
|
int log_cpu = log2_intptr(os::active_processor_count());
|
||||||
int loglog_cpu = log2_intptr(MAX2(log_cpu, 1));
|
int loglog_cpu = log2_intptr(MAX2(log_cpu, 1));
|
||||||
count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2;
|
count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// On 32-bit systems, the number of compiler threads is limited to 3.
|
||||||
|
// On these systems, the virtual address space available to the JVM
|
||||||
|
// is usually limited to 2-4 GB (the exact value depends on the platform).
|
||||||
|
// As the compilers (especially C2) can consume a large amount of
|
||||||
|
// memory, scaling the number of compiler threads with the number of
|
||||||
|
// available cores can result in the exhaustion of the address space
|
||||||
|
/// available to the VM and thus cause the VM to crash.
|
||||||
|
if (FLAG_IS_DEFAULT(CICompilerCount)) {
|
||||||
|
count = 3;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
set_c1_count(MAX2(count / 3, 1));
|
set_c1_count(MAX2(count / 3, 1));
|
||||||
set_c2_count(MAX2(count - c1_count(), 1));
|
set_c2_count(MAX2(count - c1_count(), 1));
|
||||||
|
|
|
@ -2472,9 +2472,11 @@ bool Arguments::check_vm_args_consistency() {
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _LP64
|
||||||
if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
|
if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
|
||||||
warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
|
warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SUPPORT_RESERVED_STACK_AREA
|
#ifndef SUPPORT_RESERVED_STACK_AREA
|
||||||
if (StackReservedPages != 0) {
|
if (StackReservedPages != 0) {
|
||||||
|
|
|
@ -138,9 +138,15 @@ void SimpleThresholdPolicy::initialize() {
|
||||||
FLAG_SET_DEFAULT(CICompilerCount, 3);
|
FLAG_SET_DEFAULT(CICompilerCount, 3);
|
||||||
}
|
}
|
||||||
int count = CICompilerCount;
|
int count = CICompilerCount;
|
||||||
|
#ifdef _LP64
|
||||||
|
// On 64-bit systems, scale the number of compiler threads with
|
||||||
|
// the number of cores available on the system. Scaling is not
|
||||||
|
// performed on 32-bit systems because it can lead to exhaustion
|
||||||
|
// of the virtual memory address space available to the JVM.
|
||||||
if (CICompilerCountPerCPU) {
|
if (CICompilerCountPerCPU) {
|
||||||
count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
|
count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
set_c1_count(MAX2(count / 3, 1));
|
set_c1_count(MAX2(count / 3, 1));
|
||||||
set_c2_count(MAX2(count - c1_count(), 1));
|
set_c2_count(MAX2(count - c1_count(), 1));
|
||||||
FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
|
FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue