JDK-8217659 : monitor_logging updates from Async Monitor Deflation project
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-01-23
  • Updated: 2019-08-15
  • Resolved: 2019-01-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b07Fixed
Description
This sub-task captures updates and additions to the
baseline monitor logging code. 

The updates and additions include:

- The '-XX:+TraceMonitorInflation' option now maps to LogLevel::Trace
  instead of LogLevel::Debug. The existing 'monitorinflation' logging is
  about per-object ObjectMonitor inflation and deflation so it is way too
  verbose for LogLevel::Debug.
- Add support for calling ObjectSynchronizer::audit_and_print_stats()
  at LogLevel::Info when the VM is exiting and at LogLevel::Debug
  when ObjectSynchronizer::finish_deflate_idle_monitors() is called
  at the end of that safepoint cleanup phase.
  - With 'info' level logging, you get output at the end of the VM's life.
  - With 'debug' level logging, you get output at each safepoint.
- Add DeflateMonitorCounters::perThreadScavenged to track the
  number of monitors scavenged per-thread.
- Add 'deflating global idle monitors' log output that includes deflated_count
  and how long it took; non-zero global deflation counts are reported at
  LogLevel::Info and zero global deflation counts are reported at
  LogLevel::Debug. Global deflations are much more rare than per-thread
  deflations.
- Added 'deflating per-thread idle monitors' log output that's in the same
  style as the new 'deflating global idle monitors' log output.
- Add per-thread deflation count output to the existing "safepoint+cleanup"
  logging; reporting times without counts seemed silly to me...
- Add audit_and_print_stats() to verify the global monitor lists and the
  per-thread monitor lists. Also reports info about the various lists. I'm
  planning to add output for the monitor subsystem perf-counters, but
  I haven't gotten there yet.
- Update runtime/logging/MonitorInflationTest.java to match the new
  '-Xlog:monitorinflation=' level ('trace' instead of 'debug').

I've also added a new diagnostic option for enabling extra output about
in-use monitors: '-XX:+IncludeInUseMonitorDetailsInLogMsgs'. I did it
this way to help debug an object pinning bug in my port of the prototype
and I didn't want to be overwhelmed with output. However, adding another
diagnostic option is not a good idea so this choice doesn't sit well with me
(and I wrote it).