A heap dump is a snapshot of the memory of a Java process, including everything in the JVM heap space. It is useful for figuring out why you are running out of memory.
To create my heap dump I set the -XX:+HeapDumpOnOutOfMemoryError JVM option, but to create one interactively I could also have used the jmap tool: jmap.exe -dump:live,format=b,file=<file name> <pid>
To analyze my heap dump I used the Memory Analyzer Eclipse plugin which shows things like:
- a histogram showing the number of instances per class
- dominator tree - a list of the biggest objects and what they keep alive (shown below)
- top consumers - the most expensive objects grouped by class and package
- classes loaded by multiple class loaders
- memory leak suspects
- top components - components bigger than one percent of total heap
Read full article from Demystifying Java Dumps | programming opiethehokie
No comments:
Post a Comment