Skip to content

Instantly share code, notes, and snippets.

@jebeaudet
Last active February 1, 2019 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jebeaudet/25bddb4e36653cbba3f0c83b34eff414 to your computer and use it in GitHub Desktop.
Save jebeaudet/25bddb4e36653cbba3f0c83b34eff414 to your computer and use it in GitHub Desktop.
Dump java docker heap
# install openjdk in the container
docker exec -it --user=root container_name sh
apk add openjdk8
docker exec -it <container_name> jmap -dump:format=b,file=/tmp/cheap.bin 1
# Also works
docker exec <container_name> jcmd 1 GC.heap_dump /tmp/docker.hprof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment