views:

634

answers:

2

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 somehow 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.

A: 

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.

Mike
+1  A: 

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.

ankon