首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

IBM JDK在linux上生成HeapDump日志方法

2013-02-02 
IBM JDK在linux下生成HeapDump日志方法??????? 最近服务器老是宕机,同时会生成.phd,javacore....txt等日志

IBM JDK在linux下生成HeapDump日志方法

??????? 最近服务器老是宕机,同时会生成.phd,javacore....txt等日志文件。说明此时服务器已经发生OOM或者由于其他原因导致了服务器宕机。每次必须等到服务器宕机时才能获取这些日志,服务器响应慢时,怎样手工生成这些日志分析呢?

?

??????? 通过kill -3 进程号能生成javacore....txt日志,但是没法生成.phd文件。而.phd文件是JVM内存映射文件,获取它才能分析此时JVM内存的情况,进而分析出服务器宕机的原因。

?

??????? 对于IBM JDK需要做以下设置:

??????? 1.设置JVM参数:

???????????-XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak

????????2.设置操作系统环境变量:

?????????? export IBM_HEAP_DUMP=true

?????????? export IBM_HEAPDUMP=true

?????????? export IBM_HEAPDUMP_OUTOFMEMORY=true

?????????? export IBM_JAVADUMP_OUTOFMEMORY=true

?????????? export IBM_JAVACORE_OUTOFMEMORY=true

??????? 重启服务器。如果这样仍然解决不了问题,则需要在服务器启动脚本添加一行:

??????????? #!/bin/ksh
??????????? #...
??????????? set -m
????????????some variable...

?

Resolution:
Modify the first line of the startWebLogic.sh shell script (or whatever name you are using) to cause the startup script to be run by the Korn shell (ksh), and set monitor mode in the shell script.
This is done by changing the first line of the script (the one containing "#!/bin/sh" to "#!/bin/bin/ksh" -- if that is where ksh is installed on your machine.
- then add a line: "set -m" as the first, non-comment, executable line of the shell, e.g., right before the JAVA_HOME variable is set. This causes all processes executed by the shell script to be leaders of their own process groups, allowing them to respond to the "kill -3" signal. The Korn shell must be used since the Bourne shell does not provide the "-m" setting.HP JDK生成Heapdump文件需要在在环境变量上,加上export _JAVA_HEAPDUMP=1

?

热点排行