JDK-8180421 : Change default value of BiasedLockingStartupDelay to 0
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-05-16
  • Updated: 2019-05-22
  • Resolved: 2017-06-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10 b21Fixed
Related Reports
CSR :  
Sub Tasks
JDK-8185008 :  
Description
The current default value for BiasedLockingStartupDelay is 4000, which means that biased locking won't be enabled until after 4 seconds of runtime.

This will have the effect that all objects created before biased locking is enabled will have a different mark word value than the one used after biased locking has been enabled. This is a bit problematic for GCs using the mark word, since the mark then will have to be saved and later restored when the GC is done.

There is not much documentation around why this delay was added, but the idea seems to have been to improve performance later on in the run or possibly improve startup time. 

Recent performance measurements doesn't show any significant changes in either startup or steady state performance between using the current delay or having no delay at all.


Comments
Biased Locking documentation: https://blogs.oracle.com/dave/biased-locking-in-hotspot "Eliminating Synchronization-Related Atomic Operations with Biased Locking and Bulk Rebiasing" - Russell & Detlefs, OOPSLA 2006 http://dl.acm.org/citation.cfm?doid=1167515.1167496 (subscription required for download) The introduction of the startup delay is discussed in JDK-6295591 (confidential issue - sorry): "The biased locking optimization originally introduced in Mustang build 43 induces more safepoints due to bias revocation, in particular during startup of the JVM. While optimizations have been made through the Mustang release to reduce the associated startup time penalty, it has not been completely eliminated. This change introduces a configurable delay in the enabling of biased locking at JVM startup. It currently defaults to 4000 ms. This number was chosen empirically to both eliminate the startup time regression as well as retain the benefits of the optimization on server-side benchmarks."
16-05-2017