IBM JDK生成Javacore的方法

匿名 (未验证) 提交于 2019-12-02 21:53:52
1. JVM执行异常时,自动生成Javacore
1.1 发生了引起JVM停止运行的本地错误时,会自动产生Javacore文件
1.2 JVM内存不足时,会自动产生Javacore文件
2. 触发JVM生成JDK
2.1 从命令行中发出kill -3 <pid>指令,生成Javacore
2.2 在应用中调用com.ibm.jvm.Dump.JavaDump()方法,生成Javacore
2.3 使用WAS wsadmin utility命令生成Javacore, 以Jython语言为例:
jvm = AdminControl.completeObjectName('type=JVM,process=server1,*')
AdminControl.invoke(jvm, 'dumpThreads')
2.4 可以配置dump agent触发生成Javacore
生成Javacore可以响应的事件列表如下:
2.5 可以使用trigger trace选项生成Javacore
例如:-Xtrace:trigger=method{java/lang/String.substring,javadump}
条件可以是:
method{<methodspec>[,<entryAction>[,<exitAction>[,<delayCount>
[,<matchcount>]]]]}
On entering a method that matches <methodspec>, the specified <entryAction> is run. On leaving a method that matches <methodspec>, the specified <exitAction> is run. If you specify a <delayCount>, the actions are performed only after a matching <methodspec> has been entered that many times. If you specify a <matchCount>, <entryAction> and <exitAction> are performed at most that many times.
group{<groupname>,<action>[,<delayCount>[,<matchcount>]]}
On finding any active tracepoint that is defined as being in trace group <groupname>, for example Entry or Exit, the specified action is run. If you specify a <delayCount>, the action is performed only after that many active tracepoints from group <groupname> have been found. If you specify a <matchCount>, <action> is performed at most that many times.
tpnid{<tpnid>|<tpnidRange>,<action>[,<delayCount>[,<matchcount>]]}
On finding the specified active <tpnid> (tracepoint ID) or a <tpnid> that falls inside the specified <tpnidRange>, the specified action is run. If you specify a <delayCount>, the action is performed only after the JVM finds such an active <tpnid> that many times. If you specify a <matchCount>, <action> is performed at most that many times.

参考文献

https://www.ibm.com/support/knowledgecenter/SSYKE2_6.0.0/com.ibm.java.doc.diagnostics.60/diag/tools/javadump_trigger.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!