When running a Java application with Docker, a memory leak may occur and the application may crash. Dump the heap used by java at that time so that it can be parsed.
ENV JAVA_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/dump.hprof"
docker ps -aq | xargs -I{} docker cp {}:/tmp/dump.hprof /tmp/{}_dump.hprof
Use MAT or jhat for analysis
memory analyzer (MAT)
jhat
Recommended Posts