天天看点

查看hprof文件- Eclipse Memory Analyzer安装

1,背景

服务器老是发生outofmemory,为了调查,将发生时候的heap快照保存了下来。

生成的hprof文件有1.2G,为了查看该hprof文件,使用Eclipse上的 Memory Analyzer工具

2,安装Memory Analyzer

(1)打开Eclipse–help – Eclipse Macketplace

(2)搜索memory出现下面的界面

(3)点击install

(4)安装完毕之后会让你重启一下eclipse,重启即可

查看hprof文件- Eclipse Memory Analyzer安装

另外,Eclipse重启之后,下面进去可以看到指导说明书

查看hprof文件- Eclipse Memory Analyzer安装

3,导入hprof查看内容

(1)打开Analyzer

Window > Perspective > Open Perspective > Other … > Memory Analysis

查看hprof文件- Eclipse Memory Analyzer安装

(2)导入hprof文件

File – Open heap dump – 选择hprof文件

导入之后的结果如下:

查看hprof文件- Eclipse Memory Analyzer安装

然后就可以分析了。