Jmap can't connect to make a dump

后端 未结 14 1198
青春惊慌失措
青春惊慌失措 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:29

    1.Execute "Docker ps", will give the container Id of all services and collect the container id foe TSC.
    2.Execute "docker exec -it CONTAINER_ID bash" (replace CONTAINER_ID with TSC Container id)
    3.Bash will come and then execute the "jps" on bash, that will give you the PID for process(it will be 1 for jar)
    4.Execute the "jstack PID > threadDump.tdump"(replace PID with process id received in step 3, it should be 1)
    5.Execute the "jmap -dump:format=b,file=heapDump.hprof PID"(replace PID with process id received in step 3, it should be 1)
    6.Then we have to exit the bash using "exit" command
    7.Execute "sudo docker cp CONTAINER_ID:heapDump.hprof ." from ec2 command line, that will copy the dump file on ec2 machine present working directory.
    8.Execute "sudo docker cp CONTAINER_ID:threadDump.tdump ." from ec2 command line, that will copy the dump file on ec2 machine present working directory.
    

提交回复
热议问题