appServer WAS / WebSphere / javacore.txt 、heapdump.phd、core.dmp、Snap.trc

s

 

WAS generated files: javacore.***.txt, heapdump.***.phd, core.***.dmp, Snap.***.trc

 

What are the common files generated by WAS?

Original link: http://blog.csdn.net/pqh20085101092/article/details/39370389

 

javacore.***.txt : Regarding the cpu, the javacore file is a snapshot of the java process. It mainly saves the running position of each thread of the Java application at a certain moment, that is, which class, which method, which method is executed by the JVM on one line. That is, the threaddump file.


heapdump.***.phd : Regarding memory, the heapdump file is a snapshot of the java stack at a specified time. It is a binary image file that saves the usage of objects in the JVM heap at a certain time.
 
core.***.dmp : The core file is an operating system-level process binary image file generated by java crash. Also called core dump, when an exception occurs during the running of the program and the program exits abnormally, the operating system stores the current memory status of the program in a core file.
 
Snap.***.trc : Snap files are fast-tracked tracepoint data kept in the trace buffer to analyze OOM exceptions in local memory.
 
=============================== Gorgeous dividing line================== =============
 
How to view javacore files and heapdump files?
 
 
one. View javacore files
     1. Download ThreadDumpAnalyser, graphviz, svgviewer
     ThreadDumpAnalyser: 
     https://www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c
     2. Run runall .bat javacore.txt, will generate three files dumps.xml, locktree1.svg, sidebyside.html

two. View heapdump file
     1. Download ha433 package from IBM website, release, execute ha433.jar file
     IBM HeapAnalyzer:
     https://www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=4544bafe-c7a2- 455f-9d43-eb866ea60091
     2. Open heapdump.phd in the ha433 window, from which the analysis results will be displayed
 
=============================== Gorgeous dividing line================== =============
 
How to generate javacore and heapdump files?

进入wsadmin
  D:\IBM\WebSphere\AppServer\bin>wsadmin -user wasadmin -password password

1. Generate javacore file and
set jvm environment variables:
  wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
Generate javacore file:
  wsadmin>$AdminControl invoke $jvm dumpThreads
 
/2. Generate heapdump file
to find JVM object name:
  wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,*]
Generate heapdump file:
  wsadmin> $AdminControl invoke $objectName generateHeapDump

How to view the Snap.***.trc file generated by WAS

 

When the WAS heapdump occurs, the javacore and Snap.***.trc files are also generated.


The Snap.***.trc file cannot be viewed directly and needs to be formatted. Even if it is opened with a text editor, there are still many garbled characters.



The trace formatter is a Java program that can run on any platform and can format trace files from any platform.

IBM SDK 在 core.jar 中提供了这个格式化器,它还需要一个称为 TraceFormat.dat 的文件,其中包含格式化模板。这个文件在 jre/lib 中。

可以用以下命令行启动跟踪格式化器:

 

  1. <span style="font-size:14px;">java com.ibm.jvm.format.TraceFormat input_file [output_file]</span>  

在这里,com.ibm.jvm.format.TraceFormat 是跟踪格式化器类,input_file 是要进行格式化的二进制跟踪文件的名称,output_file 是可选的输出文件名。如果没有指定输出文件,那么默认的输出文件名是输入文件名加上 .fmt。

 


IBM的dw网站有详细的说明:http://www.ibm.com/developerworks/cn/java/j-ibmjava5/index.html

 

具体实例命令如下:

 

  1. C:\Users\Administrator>cd D:\WebSphere\AppServer\java\bin  
  2.   
  3. C:\Users\Administrator>d:  
  4.   
  5. D:\WebSphere\AppServer\java\bin>java com.ibm.jvm.format.TraceFormat D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc  
  6. *** Starting data extraction from binary trace file(s)  
  7. *** Locating formatting template files  
  8. *** Found D:\WebSphere\AppServer\java\jre\lib\J9TraceFormat.dat  
  9. *** Found D:\WebSphere\AppServer\java\jre\lib\TraceFormat.dat  
  10. *** Loading further formatting templates from D:\WebSphere\AppServer\java\jre\lib\TraceFormat.dat  
  11. *** Extracting 89 buffers from D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc  
  12. *** Sorting buffers  
  13. *** Starting formatting of entries into text file D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc.fmt  
  14. *** Number of traced threads = 89  
  15. 0102030405060708090100%  
  16. *** Number of formatted tracepoints = 17114  
  17. *** Formatting complete  
  18. *** Formatted output written to file: D:\WebSphere\AppServer\profiles\AppSrv04\Snap.20150709.143231.10516.0001.trc.fmt  
  19. 0 errors were detected during formatting  
  20.   
  21. D:\WebSphere\AppServer\java\bin>  

 

Snap.***.trc文件格式化之后就可以使用文本编辑器查看了


 

参考资料:http://bbs.landingbj.com/t-0-177321-1.html 

 

linux was trc文件生成fmt方法,root用户调用命令

[root@Loadrunner19 ~]# /opt/IBM/WebSphere/AppServer/java/bin/java com.ibm.jvm.format.TraceFormat /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/Snap.20160822.154449.11135.0003.trc  /opt/test.fmt

 

 

end

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326564948&siteId=291194637