原文地址
線上服務 full gc 時,使用下面方式查詢問題
-
jmap -dump:live,format=b,file=dump.hprof XXXX
其中 XXX 爲進程號 -
wget http://ftp.jaist.ac.jp/pub/eclipse/mat/1.9.1/rcp/MemoryAnalyzer-1.9.1.20190826-linux.gtk.x86_64.zip
- 修改配置參數,按需要修改使用內存大小
-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505 -vmargs -Xms16g -Xmx16g
-
./ParseHeapDump.sh ../today_heap_dump/dump.hprof org.eclipse.mat.api:suspects
- 還可以使用另外兩個 參數
- org.eclipse.mat.api:overview
- org.eclipse.mat.api:top_components
-
最後,命令執行的結果裏面,會有一個壓縮文件,down 下來,就可以分析問題原因了