IBM JDK在linux下產生HeapDump日誌方法

來源:互聯網
上載者:User

IBM JDK在linux下產生HeapDump日誌方法     最近伺服器老是宕機,同時會產生.phd,javacore....txt等記錄檔。說明此時伺服器已經發生OOM或者由於其他原因導致了伺服器宕機。每次必須等到伺服器宕機時才能擷取這些日誌,伺服器響應慢時,怎樣手工產生這些日誌分析呢? 通過kill -3 進程號能產生javacore....txt日誌,但是沒法產生.phd檔案。而.phd檔案是JVM記憶體對應檔,擷取它才能分析此時JVM記憶體的情況,進而分析出伺服器宕機的原因。  www.2cto.com   對於IBM JDK需要做以下設定:1.設定JVM參數:   -XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak2.設定作業系統內容變數:   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...   www.2cto.com  參考知識:Issue: When WebLogic server (any version) is started in the background on a UNIX system, "kill -3" will not produce a thread dump as it does when the JVM is run in the foreground. This causes problems for support and debugging since some installations run WebLogic under nohup in the background so that the process is no longer associated with a terminal (so the originating terminal can logoff). 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 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.