0

I am using eclipse, i want to get heap dump after my program finishes its process successfully. My program does not get heap space error or something but still i want to look at heap dump with eclipse memory analyzer. Actually what i want is a heap dump that generated automatically when program finishes succesfully like -XX:+HeapDumpOnOutOfMemoryError parameter which generates the heap dump when getting out of memory error automatically.

Any advice would be helpful. Thanks.

mft
  • 319
  • 1
  • 5
  • 19

1 Answers1

0

You can generate a heap dump with jmap which is inlcuded in the JDK.

A heap dump can be generated by the command line:

jmap -dump : live, format = b , file = < filename> < PID>

See http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html for further details.

René Winkler
  • 6,508
  • 7
  • 42
  • 69