1、下载linux版本的mat

wget http://eclipse.stu.edu.tw/mat/1.9.0/rcp/MemoryAnalyzer-1.9.0.20190605-linux.gtk.x86_64.zip

2、解压zip包

unzip MemoryAnalyzer-1.9.0.20190605-linux.gtk.x86_64.zip

3、修改linux mat的堆内存大小(看自己下载的堆的大小,默认mat的堆支持1g)

 vi MemoryAnalyzer.ini

 

 -startup
 plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar
 --launcher.library
 plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.700.v20180518-1200
 -vmargs
 -Xmx10240m

  由于我们的堆内存过大,所以设置mat的最大堆为10g

4、执行分析脚本

 ./ParseHeapDump.sh [hprof文件]  org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components

可能失败

原因jdk版本较低

修改脚本的jdk版本

export JAVA_HOME=/opt/soft/jdk/jdk1.8.0_66/
export PATH=$JAVA_HOME/bin:$PATH
"$(dirname -- "$0")"/MemoryAnalyzer -consolelog -application org.eclipse.mat.api.parse "$@"

  

 5、查看输出的文件夹

linux版本mat使用

 

 linux版本mat使用

 

很方便的看出堆内存的情况

 

相关文章:

  • 2021-04-21
  • 2022-12-23
  • 2021-08-26
  • 2021-07-27
  • 2021-07-18
  • 2021-11-05
  • 2021-12-12
  • 2022-01-21
猜你喜欢
  • 2021-12-21
  • 2021-12-16
  • 2021-08-24
  • 2021-07-28
  • 2022-01-19
  • 2021-07-15
相关资源
相似解决方案