comparison hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @ 36556:7f092a7ce938

8150839: Adjust the number of compiler threads for 32-bit platforms Summary: Set the number of compiler threads to 3 on 32-bit platforms. Reviewed-by: iveresov
author zmajo
date Fri, 04 Mar 2016 08:53:59 +0100
parents 0ee84aa8e705
children ee256e343585
comparison
equal deleted inserted replaced
25:d6a560206797 26:031b10f08178
40 threshold_scale(CompLevel_full_optimization, Tier4LoadFeedback)); 40 threshold_scale(CompLevel_full_optimization, Tier4LoadFeedback));
41 41
42 } 42 }
43 43
44 void AdvancedThresholdPolicy::initialize() { 44 void AdvancedThresholdPolicy::initialize() {
45 int count = CICompilerCount;
46 #ifdef _LP64
45 // Turn on ergonomic compiler count selection 47 // Turn on ergonomic compiler count selection
46 if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) { 48 if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) {
47 FLAG_SET_DEFAULT(CICompilerCountPerCPU, true); 49 FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
48 } 50 }
49 int count = CICompilerCount;
50 if (CICompilerCountPerCPU) { 51 if (CICompilerCountPerCPU) {
51 // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n 52 // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
52 int log_cpu = log2_intptr(os::active_processor_count()); 53 int log_cpu = log2_intptr(os::active_processor_count());
53 int loglog_cpu = log2_intptr(MAX2(log_cpu, 1)); 54 int loglog_cpu = log2_intptr(MAX2(log_cpu, 1));
54 count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2; 55 count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2;
55 } 56 }
57 #else
58 // On 32-bit systems, the number of compiler threads is limited to 3.
59 // On these systems, the virtual address space available to the JVM
60 // is usually limited to 2-4 GB (the exact value depends on the platform).
61 // As the compilers (especially C2) can consume a large amount of
62 // memory, scaling the number of compiler threads with the number of
63 // available cores can result in the exhaustion of the address space
64 /// available to the VM and thus cause the VM to crash.
65 if (FLAG_IS_DEFAULT(CICompilerCount)) {
66 count = 3;
67 }
68 #endif
56 69
57 set_c1_count(MAX2(count / 3, 1)); 70 set_c1_count(MAX2(count / 3, 1));
58 set_c2_count(MAX2(count - c1_count(), 1)); 71 set_c2_count(MAX2(count - c1_count(), 1));
59 FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count()); 72 FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count());
60 73