Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8201235

Lazy allocation of compiler threads

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 11
    • hotspot
    • None
    • behavioral
    • minimal
    • Potential decreased startup performance for some applications; can be reverted by explicit specification of -XX:-UseDynamicNumberOfCompilerThreads on the command line.
    • add/remove/modify command line option
    • JDK

      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/

            mdoerr Martin Doerr
            mdoerr Martin Doerr
            David Holmes, Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: