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

Lazy allocation of compiler threads

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Potential decreased startup performance for some applications; can be reverted by explicit specification of -XX:-UseDynamicNumberOfCompilerThreads on the command line.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      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

              • Assignee:
                mdoerr Martin Doerr
                Reporter:
                mdoerr Martin Doerr
                Reviewed By:
                David Holmes, Vladimir Kozlov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: