The current default value for BiasedLockingStartupDelay is 4000, JDK-8180421 proposes to change this default to 0.
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.
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.
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) \
- csr of
JDK-8180421 Change default value of BiasedLockingStartupDelay to 0