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
- csr of
-
JDK-8348829 Remove ObjectMonitor perf counters
-
- Open
-
- relates to
-
JDK-8351146 JFR: JavaMonitorInflate event should default to no threshold and be disabled
-
- Resolved
-