Is it possible to view threads from hprof dump / threads in heap dump

Jayan picture Jayan · Sep 12, 2012 · Viewed 10.7k times · Source

I have got a large (5GB) hprof dump, created by application when OutOfMemoryError occurred. (Using XX: HeapDumpOnOutOfMemoryError ).

Unfortunately there are no logs collected when this error happened. Re-creating this will take couple of hours. I was hoping if some tools could show the exception stack trace or all threads stacks etc from hprof.

I am currently using MAT, could not see a way to get thread information. Which tool I could use?

(I am not sure if hprof file has information about thread/location of call when OOM occurred).

( I do know to how to take thread dump in normal cases. The trouble here is the event already happened, all I have is the hprof dump. )

Answer

Jayan picture Jayan · Sep 12, 2012

Answering own question. Credit goes to @ RC

  1. Open the dump using visualvm. It takes a while.
  2. click on "threads at heap dump"

visual vm with threads at heapdump