Release Note: The `LockingMode` Flag and the `LM_LEGACY` And `LM_MONITOR` Modes Are Deprecated

XMLWordPrintable

      A new, lightweight locking mechanism for 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 JDK 23, the `LockingMode` default was changed to `LM_LIGHTWEIGHT`.

      In JDK 24, the `LockingMode` flag, along with the `LM_LEGACY` (1) and `LM_MONITOR` (0) modes, are deprecated. The default locking mode, `LM_LIGHTWEIGHT`, will be the only internal implementation that is supported when these locking modes become obsolete in a future release.

      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.

            Assignee:
            Coleen Phillimore
            Reporter:
            Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: