1、top                                           查看占用cpu最高的进程pid
eg:
cpu彪高的排查步骤

 

 

2、top -Hp 进行pid                       获取消耗cpu最多的线程pid
eg:top -Hp 1397
cpu彪高的排查步骤

 

 


 

 

3、printf "0x%x\n"  线程pid           得到线程pid的16进制
cpu彪高的排查步骤

 

 

4、  sudo -u username jstack -l  进程pid|grep “线程pid”>> a.txt
eg:sudo -u tomcat jstack -l 1397|grep "0x5ba">> a.txt
 
注意:
    jstack需要使用与进程一致的用户才能执行  否则会报错:Operation not permitted
   如何查询进程的user:
    ps -aux|grep "进程pid"
   切换用户:
   sudo -u username jstack -l  进程pid >> a.txt
cpu彪高的排查步骤

 

 

相关文章:

  • 2021-04-18
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-07-29
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2021-04-26
  • 2022-12-23
  • 2021-05-17
  • 2021-10-06
  • 2021-07-01
相关资源
相似解决方案