When JVM crashes with OutOfMemoryError
there are some options to store a dump:
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=./java_pid<pid>.hprof
but what does it happen in kubernetes cluster after crashing? It seems kubernetes will clean up everything related to the pod crushed? How can I save it?
just mount it as a volume.
volumeMounts:
- name: heap-dumps
mountPath: /dumps
volumes:
- name: heap-dumps
emptyDir: {}