JDK-8029436 : CICompilerCount is not updated when the number of compiler threads is adjusted to the number of CPUs
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-12-03
  • Updated: 2014-07-29
  • Resolved: 2014-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u20Fixed 9 b11Fixed
CICompilerCount holds the number of compiler threads. (Maybe we should also rename the flag, since it does not set the number of 'compilers' but the number of compiler threads - so maybe CICompilerThreads is more appropriate).
The number of compiler threads is set in simpleThresholdPolicy.cpp and advancedThresholdPolicy.cpp  but CICompilerCount is not updated accordingly. CICompilerCount is used (and contains a wrong value) in compilebroker.cpp .

There was long discussion with Tobias on IM last night and I agreed to update CICompilerCount.

I don't think it is a problem. It is 2 different ways to set number of compiler threads and they were never intended to be used together. Current code implies that CICompilerCountPerCPU takes priority. CICompilerCount does not hold number of compiler threads, that number is calculated in overwritten methods CompilationPolicy::initialize() and stored in local fields in the policy structure. Changing a product flag is a big pain (CCC request) especially for very old and well known. If you want to make clear the count settings you can modify comment for CICompilerCountPerCPU in globals.hpp that "it takes priority over CICompilerCount" or something more english. And you can print number of compiler threads in initialize() (c1 and c2 depending on and VM and the mode we are running) when PrintMiscellaneous && Verbose is true.

The issue can be reproduced by the following command: Command: java -XX:CICompilerCount=200 -XX:+CICompilerCountPerCPU -XX:+PrintFlagsFinal -version | grep CICompilerCount Output: intx CICompilerCount := 200 The number of compiler threads is actually _not_ set to 200, but according to the number of CPUs because CICompilerCountPerCPU is set. The problem is that CICompilerCount is not updated.