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

Change default value of BiasedLockingStartupDelay to 0

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Change in default values can impact some users in an unexpected way.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      Implementation

      Description

      Summary

      The current default value for BiasedLockingStartupDelay is 4000, JDK-8180421 proposes to change this default to 0.

      Problem

      The current default value was chosen a long time ago and it is today unclear if there is any benefit of having it. Benchmark runs doesn't show any regressions for either startup times or steady state performance when setting it to 0.

      The delay is however a problem for the some of the GC algorithms that use the mark-word. It will postpone the enabling of biased locking until the delay has passed and because of this all objects created before that will later on need special handling during GC.

      Solution

      Setting the default value for the delay to 0 will avoid the GC issue and since no other obvious regressions have been seen with this change it seems like the best option.

      An alternative solution would be to remove the delay and always just start using biased locking directly, but there might be cases where we want to enable the user manually set a delay.

      Specification

      Since the change only alters a default value it is very simple, here's the complete diff:

      diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
      --- a/src/share/vm/runtime/globals.hpp
      +++ b/src/share/vm/runtime/globals.hpp
      @@ -1300,7 +1300,7 @@
         product(bool, UseBiasedLocking, true,                                     \
                 "Enable biased locking in JVM")                                   \
                                                                                   \
      -  product(intx, BiasedLockingStartupDelay, 4000,                            \
      +  product(intx, BiasedLockingStartupDelay, 0,                               \
                 "Number of milliseconds to wait before enabling biased locking")  \
                 range(0, (intx)(max_jint-(max_jint%PeriodicTask::interval_gran))) \
                 constraint(BiasedLockingStartupDelayFunc,AfterErgo)               \

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sjohanss Stefan Johansson
                Reporter:
                sjohanss Stefan Johansson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: