Use of Jstack

 

1. First find the Java process

  top

  ps to | grep java

2. Find the thread according to the pid

  top -Hp pid

  ps -mp pid -o THREAD,tid,time

3. Get the hexadecimal value of the thread id

  printf "%x\n" tid

4. Output the stack information of the thread and execute jstack in the bin directory of jdk

  ./jstack pid | grep tid hex >> ./a.txt --- output data into a.txt file

 

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325653225&siteId=291194637