Follow the below steps to take the thread and Heap dumps from a docker container
1. Run the below command to bash into the container. Please change the CONTAINER_NAME appropriately
docker exec -it CONTAINER_NAME bash
2. Then type jps to find the all the Java application details and extract the PID for your application
jps
3. Then run the below command to get the thread dump. Please change the PID(Process id) appropriately.
jstack PID > threadDump.tdump
4. Then run the below command to get the Heapdump. Please change the PID appropriately
jmap -dump:live,format=b,file=heapDump.hprof PID
5. Then exit from the docker container and download the threadDump.tdump and heapDump.hprof from the docker container by running the below command. Please change the CONTAINER_NAME appropriately
Thread Dump and Heap Dump from a running container
Archives
Categories
Recent Posts
Stopping and Removing Containers
29 May 2019Installing Amazon CLI and Terraform on Windows desktop
27 May 2019Convert DOS to UNIX and vice versa
25 May 2019Calendar