About the Memory debug and heap dump tips:
Feb 2016 By W.ZH
It is needed to debug the java memeory usage when you face some issues like the OutOfMemoryError in Java.
Here is summary some common usages I used in projects:
1. How to trigger a automatically memory dump for a JVM when it faces a OutOfMemoryError?
Just add these options to the Java
It will create a java_pid.hprof file in the DumpPath.
jmap -dump:file=path_to_file 12341234 here is your java process id.
You can use the eclipse plugin to do this. Normally I use “Memory Analyzer”
After install the Plugin open this perspective to use it.
Window –> open perspective –> other –> Memmory Analysis
then go to menu of :
File –> Open Heap Dump to read in a dump file.
Same with 3, use the “Memory Analyzer” http://www.eclipse.org/mat/
Use it to create a new dump project and do the dump. refer the some tips and tutorial of “Memory Analyzer”, Not hard to use it.