--- old/src/share/vm/runtime/simpleThresholdPolicy.cpp 2013-10-21 11:47:07.855829164 +0200 +++ new/src/share/vm/runtime/simpleThresholdPolicy.cpp 2013-10-21 11:47:07.791829165 +0200 @@ -134,15 +134,19 @@ } void SimpleThresholdPolicy::initialize() { - if (FLAG_IS_DEFAULT(CICompilerCount)) { - FLAG_SET_DEFAULT(CICompilerCount, 3); + // No need to set number of compiler threads if the VM is started with -Xint + assert ((c1_count() == 0) && (c2_count() == 0), "Must be initialized to 0"); + if (Arguments::mode() != Arguments::_int) { + if (FLAG_IS_DEFAULT(CICompilerCount)) { + FLAG_SET_DEFAULT(CICompilerCount, 3); + } + int count = CICompilerCount; + if (CICompilerCountPerCPU) { + count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2; + } + set_c1_count(MAX2(count / 3, 1)); + set_c2_count(MAX2(count - count / 3, 1)); } - int count = CICompilerCount; - if (CICompilerCountPerCPU) { - count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2; - } - set_c1_count(MAX2(count / 3, 1)); - set_c2_count(MAX2(count - count / 3, 1)); } void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) { --- old/src/share/vm/runtime/compilationPolicy.cpp 2013-10-21 11:47:07.879829164 +0200 +++ new/src/share/vm/runtime/compilationPolicy.cpp 2013-10-21 11:47:07.791829165 +0200 @@ -199,6 +199,11 @@ // - if neither is defined - always return zero. int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); + // No need for compiler threads if the VM is started with -Xint + if (Arguments::mode() == Arguments::_int) { + return 0; + } + #ifdef COMPILER2 if (is_c2_compile(comp_level)) { return _compiler_count; --- old/src/share/vm/runtime/advancedThresholdPolicy.cpp 2013-10-21 11:47:07.903829163 +0200 +++ new/src/share/vm/runtime/advancedThresholdPolicy.cpp 2013-10-21 11:47:07.791829165 +0200 @@ -52,8 +52,12 @@ count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2; } - set_c1_count(MAX2(count / 3, 1)); - set_c2_count(MAX2(count - count / 3, 1)); + assert ((c1_count() == 0) && (c2_count() == 0), "Must be initialized to 0"); + // Set number of compiler threads only if we also use the compiler + if (Arguments::mode() != Arguments::_int) { + set_c1_count(MAX2(count / 3, 1)); + set_c2_count(MAX2(count - count / 3, 1)); + } // Some inlining tuning #ifdef X86 --- old/src/share/vm/compiler/compileBroker.cpp 2013-10-21 11:47:07.919829163 +0200 +++ new/src/share/vm/compiler/compileBroker.cpp 2013-10-21 11:47:07.799829165 +0200 @@ -806,8 +806,10 @@ // Initialize the CompileTask free list _task_free_list = NULL; - // Start the CompilerThreads - init_compiler_threads(c1_count, c2_count); + // Start compiler thread(s) + if (c1_count > 0 || c2_count > 0) { + init_compiler_threads(c1_count, c2_count); + } // totalTime performance counter is always created as it is required // by the implementation of java.lang.management.CompilationMBean. {