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

G1 ConcurrentG1RefineThread::stop delays JVM shutdown for >150ms

    XMLWordPrintable

Details

    • gc
    • b108
    • Not verified

    Description

      G1 introduces >150 ms shutdown lag, allegedly because of Terminator_lock wait in ConcurrentG1RefineThread::stop. This can be demonstrated with a trivial HelloWorld application and G1 instrumentation:
        http://cr.openjdk.java.net/~shade/8136854/Hello.java
        http://cr.openjdk.java.net/~shade/8136854/tracing.patch

      Timing on 1x4x2 i7-4790K, Linux x86_64, jdk9/dev at Sep 21, 2015.

      $ time java -XX:+UseParallelGC Hello
      Hello World

      real 0m0.030s
      user 0m0.036s
      sys 0m0.000s

      $ time java -XX:+UseConcMarkSweepGC Hello
      Hello World

      real 0m0.032s
      user 0m0.028s
      sys 0m0.008s

      $ time java Hello
      Hello World
      ConcurrentG1RefineThread waited for Terminator_lock for 168 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec
      ConcurrentG1RefineThread waited for Terminator_lock for 0 msec

      real 0m0.208s
      user 0m0.040s
      sys 0m0.004s

      We can clearly see that waiting on Terminator_lock wastes ~150msec. This issue blocks the development of startup performance-sensitive JDK features, as the startup overheads drown in this G1 delay.

      Attachments

        Issue Links

          Activity

            People

              tschatzl Thomas Schatzl
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: