3 Replies Latest reply on Apr 15, 2010 9:02 PM by 843798

    Getting histogram from .hprof heap dump file

      The documentation at [http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html#gbywi|http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html#gbywi] contains the following sentence:

      +"If you specify the -XX:+HeapDumpOnOutOfMemoryError command-line option, and if an OutOfMemoryError is thrown, the VM generates a heap dump. You can then use the jmap utility to obtain a histogram from the heap dump."+

      I have a .hprof heap dump file (my system ran out of memory, and dumped its heap), but I see no way to use jmap to create a histogram from it. Is this sentence wrong, or am I just missing something? I can see options to do stuff from core files, but not heap dump files.

      I am trying to use jhat to get a histogram, but the heap is around 4Gb, and although jhat managed to load the file (when I gave it 23Gb of memory), it seems to be taking forever to display the histogram.

      Alternatively, does anyone know of any other ways to get a histogram from a heap dump file?