Jmap can't connect to make a dump

后端 未结 14 1183
青春惊慌失措
青春惊慌失措 2020-12-12 17:47

We have an open beta of an app which occasionally causes the heapspace to overflow. The JVM reacts by going on a permanent vacation.

To analyze this I would like to

相关标签:
14条回答
  • 2020-12-12 18:47

    The solution was very simple. I was running the jmap as root, but I had to run it as the user who started the jvm. I will now go hide my head in shame.

    0 讨论(0)
  • 2020-12-12 18:49

    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
    
    1. Then type jps to find the all the Java application details and extract the PID for your application
    jps
    
    1. Then run the below command to get the thread dump. Please change the PID appropriately

      jstack PID > threadDump.tdump 
      
    2. Then run the below command to get the Heap dump. Please change the PID appropriately

        jmap -dump:live,format=b,file=heapDump.hprof PID 
    
    1. 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
     sudo docker cp CONTAINER_NAME:threadDump.tdump .
     sudo docker cp CONTAINER_NAME:heapDump.hprof .
    
    0 讨论(0)
提交回复
热议问题