JDK-6224040 : enhance jstat to extract counter information from core files
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-01
  • Updated: 2016-08-29
  • Resolved: 2016-08-29
Related Reports
Relates :  
Description
When the jvmstat counters are available in core dumps, it would
be useful if jstat could access them directly from the core dump.
jstat should be enhanced to recognize that it's dealing with a
core file and find the location of the counters and display the
information.
###@###.### 2005-2-01 15:36:32 GMT
###@###.### 2005-2-02 13:50:03 GMT

Comments
This feature has not recently been requested, if additional requirements surface we will revisit this issue. Closing as WNF.
29-08-2016

EVALUATION shared pages are not dumped in core dumps (atleast in Unix platforms). we have facility in SA to read jstat counters from core dumps -- but it does not work in platforms where shared (MAP_SHARED) pages are not dumped in core dumps. While Solaris 10+ supports arbitrary pages to be dumped in core dumps, it is unlikely that shared pages will be dumped in core dumps.
04-10-2006

SUGGESTED FIX Add a new sun.jvmstat.perfdata.monitor.protocol type for core files and create the PerfDataBuffer from a file mapping of the appropriate section of the core file. The protocol will need to determine the offset of the start of the instrumentation buffer in the core file. Another alternative is to somehow merge the SA's JSnap tool into jstat. ###@###.### 2005-2-01 15:36:32 GMT Whether we use SA's JSnap tool or use file mapping of appropriate section of core file, we have the following issue. By default, perf data is mapped to a MAP_SHARED, PROT_READ|PROF_WRITE pages. Shared pages that are backed by file are not dumped into core dumps (on Solaris and Linux. On Windows, such pages are dumped into Dr Watson dump). With Solaris 10, we can configure the OS to dump such pages into core dump using the following coreadm command: coreadm -P shfile It appears that pre-Solaris-10 OS'es can't be configured to dump such pages into core dumps. So, we can either this only on Solaris 10+ or we can ask the users to run hotspot VM with -XX:+PerfDisableSharedMem -- so that perf data is mapped to non-shared pages and thereby dumped to core dumps. ###@###.### 2005-2-07 12:29:04 GMT
01-02-2005

WORK AROUND Use dd to extract the data from the core file and save it to a file. Then, invoke jstat with a file url to the saved file: dd if=/path/to/core of=/path/to/file bs=32k iseek=N count=1 jstat -snap file:///path/to/file Alternatively, one can save a copy of the hsperfdata file before starting another jvm. If another jvm is started before saving a copy of the file from the crashed jvm, then the subsequent jvm invocation will remove the stale file before you have a chance to copy it. Once a file has been saved, use a file url as above to access the data. ###@###.### 2005-2-01 15:36:32 GMT
01-02-2005