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

Lazy allocation of compiler threads

    XMLWordPrintable

Details

    • CSR
    • Status: Closed
    • P4
    • Resolution: Approved
    • 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

    Description

      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/

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: