Summary
Allocate and remove compiler threads on demand depending on the compile queue lengths and available memory.
Problem
The VM currently starts a large number of compiler threads on systems with many CPUs regardless of available memory and number of compilation requests. This leads to inefficient use of resources. They consume memory even if they are idle almost all of the time.
A similar issue regarding GC was addressed with the option UseDynamicNumberOfGCThreads which is now active by default.
Solution
Change the implementation to start only one compiler thread of each type during startup and handle the start and shutdown of further threads dynamically controlled by a new command line flag:
-XX:+UseDynamicNumberOfCompilerThreads
This is the main flag which controls this feature. It is on by default.
Specification
product(bool, UseDynamicNumberOfCompilerThreads, true, \
"Dynamically choose the number of parallel compiler threads") \
\
http://cr.openjdk.java.net/~mdoerr/8198756_CompilerCount/webrev.05/
- csr of
-
JDK-8198756 Lazy allocation of compiler threads
- Resolved