Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319251 [REDO] Change LockingMode default from LM_LEGACY to LM_LIGHTWEIGHT
  3. JDK-8327089

Release Note: Change LockingMode Default from `LM_LEGACY` to `LM_LIGHTWEIGHT`

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 23
    • 23
    • hotspot

      A new lightweight locking mechanism for uncontended object monitor locking was introduced in JDK 21 under JDK-8291555. The `LockingMode` flag was introduced to allow selection of this new mechanism (`LM_LIGHTWEIGHT`, value 2) in place of the default mechanism (`LM_LEGACY`, value 1). In this release, the `LockingMode` default has been changed to `LM_LIGHTWEIGHT`.

      This is not expected to change any semantic behavior of Java monitor locking. It is expected to be performance neutral for almost all applications.

      If you need to revert to the legacy mechanism, you can set the command-line flag `-XX:LockingMode=1`, but note that legacy mode is expected to be removed in a future release.

            dcubed Daniel Daugherty
            lfoltan Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: