JVM工具 MemoryAnalyzer使用

简单使用

cd /home/hd/hprof_file/

/home/hd/memoryAnalyzer/ParseHeapDump.sh  /home/hd/hprof_file/app.hprof  org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components
  • org.eclipse.mat.api:suspects:表示生成内存泄露报告
  • org.eclipse.mat.api:overview:表示生成概述报告
  • org.eclipse.mat.api:top_components:表示生成大对象报告

自己环境的脚本如下:

[apps@HZVM017149 dump]$ cat start.sh 
source /etc/profile
nohup /data/soft/mat/ParseHeapDump.sh $1  org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components &


[apps@HZVM017149 dump]$ cat /data/soft/mat/ParseHeapDump.sh
#!/bin/sh
#
# This script parses a heap dump.
#
# Usage: ParseHeapDump.sh <path/to/dump.hprof> [report]*
#
# The leak report has the id org.eclipse.mat.api:suspects
# The top component report has the id org.eclipse.mat.api:top_components
#

"$(dirname -- "$0")"/MemoryAnalyzer -consolelog -application org.eclipse.mat.api.parse "$@"
[apps@HZVM017149 dump]$ cd /data/soft/mat/


[apps@HZVM017149 mat]$ ls -l MemoryAnalyzer
-rwxr-xr-x. 1 root root 73064 Jul 25  2019 MemoryAnalyzer


[apps@HZVM017149 dump]$ ./start.sh  44052_heap.bin 

 

 

 

解释  分析完成后会生成三个zip包

  • app_Leak_Suspects.zip
  • app_System_Overview.zip
  • app_Top_Components.zip

 

查看

我们排查内存泄露问题可以主要看app_Leak_Suspects.zip 这个压缩包下的内容。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值