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

Details

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

    Description

      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 and 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 it is expected the legacy mode will be removed in a future release.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: