We run our Java application in k8s, using Docker as the container runtime, and when memory leak occurs, the application crash.
So for troubleshooting we take heap dumps by setting -XX:HeapDumpPath=/home/dump.hprof"
, but as the container crashes we lose the file and are not able to get it.
One solution we got was before the container crashes, ie the kill signal is parsed to docker for killing the container, we push the file to s3.
Another was mount a volume to pod and specify the path to save the file.
Are there any alternative solutions for this?