JDK-8087107 : Expose code cache statistics via perfdata counters
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2015-06-10
  • Updated: 2019-01-15
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
The size of the code cache, its usage and the activity of the code cache sweeper would be useful information to export and track via perf data counters.

I am attaching a patch (based on jdk 8uXX version of hotspot) which exposes a few new counters, viz, the top few lines in the display below:

$ jcmd <pid> PerfCounter.print | grep -i "sun\.ci\."
sun.ci.codeCacheCapacity=6291456
sun.ci.codeCacheMaxCapacity=6291456
sun.ci.codeCacheMethodsReclaimedNum=1030
sun.ci.codeCacheSweepsTotalNum=93
sun.ci.codeCacheSweepsTotalTimeMillis=63
sun.ci.codeCacheUsed=3386880
...


These counters are useful to quickly assess code cache churn and sweeper activity.
Comments
I'm in favor of adding more code cache data to the perfdata counters. * The current patch is missing tests. * It would be good if terminology and data points were aligned between the trace events (trace.xml) and the perfdata counters.
15-06-2015

JVM stat stuff is worked on by both Runtime and Serviceability teams. The counters themselves are for the code cache which is the Compiler team. Moving to hotspot/compiler for now.
10-06-2015

codecache.patch attached (as in description).
10-06-2015