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

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 23
    • Affects Version/s: 23
    • Component/s: 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.

            Assignee:
            Daniel Daugherty
            Reporter:
            Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: