Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading a large hprof into jhat

I have a 6.5GB Hprof file that was dumped by a 64-bit JVM using the -XX:-HeapDumpOnOutOfMemoryError option. I have it sitting on a 16GB 64-bit machine, and am trying to get it into jhat, but it keeps running out of memory. I have tried passing in jvm args for minimum settings, but it rejects any minimum, and seems to run out of memory before hitting the maximum.

It seems kind of silly that a jvm running out of memory dumps a heap so large that it can't be loaded on a box with twice as much ram. Are there any ways of getting this running, or possibly amortizing the analysis?

like image 334
liam Avatar asked Dec 02 '09 20:12

liam


People also ask

How do I open a Hprof GZ file?

Opening a Heap Dump File If you have a heap dump file saved on your local system, you can open the file in Java VisualVM by choosing File > Load from the main menu. Java VisualVM can open heap dumps saved in the . hprof file format. When you open a saved heap dump, the heap dump opens as a tab in the main window.

What is the size of heap dump?

What is the heap dump file size? The heap dump file size is actually 382 MiB.

What is the use of Hprof file?

HPROF is a dynamically-linked native library that uses JVM TI and writes out profiling information either to a file descriptor or to a socket in ascii or binary format. This information can be further processed by a profiler front-end tool or dumped to a file.


3 Answers

Use the equivalent of jhat -J-d64 -J-mx16g myheap.hprof as a command to launch jhat, i.e., this will start jhat in 64-bit mode with a maximum heap size of 16 gigabytes.

If the JVM on your platform defaults to 64-bit-mode operation, then the -J-d64 option should be unnecessary.

like image 164
Joel Hoff Avatar answered Oct 22 '22 08:10

Joel Hoff


I would take a look at the eclipse memory analyzer. This tool is great, and I have looked at several Gig heaps w/ this tool. The nice thing about the tool is it creates indexes on the dump so it is not all in memory at once.

like image 42
broschb Avatar answered Oct 22 '22 07:10

broschb


I had to load a 11 GB hprof file and couldn't with eclipse memory analyzer. What I ended up doing was to write a program to reduce the size of the hprof file by randomly removing instance information. Once I got the size of the hprof file down to 1GB, I could open it with eclipse memory analyzer and get a clue on what was causing the memory leak.

like image 5
vimil Avatar answered Oct 22 '22 08:10

vimil