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. )
To find the long running threads, highlight all the thread dumps you want to check, and then click on the binoculars: In the pop up dialogue, click start detection, and you'll get your long running threads just below the dumps themselves: In my example, each thread dump has 157 threads.
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.
Thread Dump is used to check whether you're stuck in a deadlock condition. Heap Dump is used to detect memory leaks.
A heap dump is a snapshot of all the objects that are in memory in the JVM at a certain moment. They are very useful to troubleshoot memory-leak problems and optimize memory usage in Java applications. Heap dumps are usually stored in binary format hprof files.
Answering own question. Credit goes to @ RC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With