WAS发生heapdump时随之还产生了javacore和Snap.***.trc文件,Snap.***.trc文件无法直接查看,需要对其进行格式化,具体做法如下:
C:\Users\Administrator>d:
C:\Users\Administrator>cd D:\WebSphere\AppServer\java\bin
D:\WebSphere\AppServer\java\bin>java com.ibm.jvm.format.TraceFormat D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc
*** Starting data extraction from binary trace file(s)
*** Locating formatting template files
*** Found D:\WebSphere\AppServer\java\jre\lib\J9TraceFormat.dat
*** Found D:\WebSphere\AppServer\java\jre\lib\TraceFormat.dat
*** Loading further formatting templates from D:\WebSphere\AppServer\java\jre\lib\TraceFormat.dat
*** Extracting 89 buffers from D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc
*** Sorting buffers
*** Starting formatting of entries into text file D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc.fmt
*** Number of traced threads = 89
0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
*** Number of formatted tracepoints = 17114
*** Formatting complete
*** Formatted output written to file: D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc.fmt
0 errors were detected during formatting
D:\WebSphere\AppServer\java\bin>
格式化后的文件可以用文本编辑器打开了。