I am trying to set the JVM of the server I am working on, so it dumps a heap to file when an OOME occurs.
I know I have to add this option -XX:-HeapDumpOnOutOf
This option from the HotSpot VM options. I would think it'd be the same in the OpenJDK VM but let me know if it's not.
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=
You can also manually generate a memory map using jmap if you know the process id:
jmap -J-d64 -dump:format=b,file=
You can use JHat to analyze the dump.
jhat