JDK-8181778 : Change default value of BiasedLockingStartupDelay to 0
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 10
  • Submitted: 2017-06-08
  • Updated: 2017-06-27
  • Resolved: 2017-06-20
Related Reports
CSR :  
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)               \
```

Comments
Voting to approve the request, acknowledging the base issue is now marked for a release note.
20-06-2017

This have been discussed on internal mailing list, there where no objections. Looks good!
13-06-2017

Accepting the request to move it to the provisional state; please find a VM or GC reviewer before finalizing.
12-06-2017

No objection from me, assuming this change is documented in a release note.
12-06-2017