开发者

Are there tools to analyse large Java heap dumps without loading the complete hprof file?

开发者 https://www.devze.com 2022-12-12 17:05 出处:网络
I use Eclipse MAT to analyse hprof files. It is very good but if you have a 2Gb heap dump then you need to run MAT with a 2Gb+ heap size itself to be able to load the complete heap dump.

I use Eclipse MAT to analyse hprof files. It is very good but if you have a 2Gb heap dump then you need to run MAT with a 2Gb+ heap size itself to be able to load the complete heap dump.

I was wondering if anyone knows of a tool that could analyse a 2Gb hprof file without using that much memory itself (e.g. it doesn't load the complete file but som开发者_C百科ehow walks through it)? This would be useful if a hprof file gets generated on a customer server as I could then run some analysis on the server instead of trying to copy a 2Gb file over a VPN.


hprof files have a format that doesn't really work well without loading it fully and then applying some cross-referencing afterwards.

However, you may be able to skip the hprof dump to get just basic information from the running VM by using jmap, jstack, and visualvm included in the JDK package. Typical memory leaks for example should be visible from the jmap heap histogram already, as you might be able to guess the places that produce or retain objects just by looking at the number of instances of a particular class.


The latest versions of YourKit handle large heap dumps much better than before. I've had good success with it and highly recommend it. A long time ago there was a tool called Auptyma by Virag Saksena, but it appears that it may have been bought by Oracle.

0

精彩评论

暂无评论...
验证码 换一张
取 消