Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8348833

Remove ObjectMonitor perf counters

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • hotspot
    • None
    • behavioral
    • low
    • Removes internal performance counters. These counters can be accessed through internal APIs or jcmd.
    • Other
    • JDK

      Summary

      Remove ObjectMonitor performance counters, exposed in sun.rt._sync* namespace.

      Problem

      There is a bunch of ObjectMonitor performance counters:

      PerfCounter * ObjectMonitor::_sync_ContendedLockAttempts = nullptr;
      PerfCounter * ObjectMonitor::_sync_FutileWakeups = nullptr;
      PerfCounter * ObjectMonitor::_sync_Parks = nullptr;
      PerfCounter * ObjectMonitor::_sync_Notifications = nullptr;
      PerfCounter * ObjectMonitor::_sync_Inflations = nullptr;
      PerfCounter * ObjectMonitor::_sync_Deflations = nullptr;

      They seem to be seldom used, and their continued maintenance comes with at least two problems, both of which come down to intrinsic race against VM shutdown, see JDK-8049304 and JDK-8348402. Additionally, these get updated on locking paths, and attempts to do extra things, including synchronization, might obscure some of the bugs.

      Some of these counters seem to be covered by related JFR events.

      These counters are accessible through internal APIs or jcmd:

      % jcmd 8090 PerfCounter.print | grep _sync
      sun.rt._sync_ContendedLockAttempts=10045275
      sun.rt._sync_Deflations=222972
      sun.rt._sync_FutileWakeups=4184363
      sun.rt._sync_Inflations=222991
      sun.rt._sync_MonExtant=7
      sun.rt._sync_Notifications=1521211
      sun.rt._sync_Parks=7667155

      Solution

      The solution is to remove these counters.

      Specification

      All counters in sun.rt._sync* would be gone, see related PR: https://github.com/openjdk/jdk/pull/23326

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: