查看Java线程占用CPU过高命令

 ps -mp 5621 -o THREAD,tid,time 查看占用cpu过高线程,找到tid

$  ps -mp 5621 -o THREAD,tid,time
USER     %CPU PRI SCNT WCHAN  USER SYSTEM   TID     TIME
bigdata   0.0   -    - -         -      -     - 01:22:37
bigdata   0.0  19    - futex_    -      -  5621 00:00:00
bigdata   0.0  19    - futex_    -      -  5624 00:00:00
bigdata   0.0  19    - futex_    -      -  5625 00:00:00
bigdata   0.0  19    - futex_    -      -  5626 00:00:00
bigdata   0.0  19    - futex_    -      -  5627 00:00:00
bigdata   0.0  19    - futex_    -      -  5628 00:00:00
bigdata   0.0  19    - futex_    -      -  5629 00:00:00
bigdata   0.0  19    - futex_    -      -  5630 00:00:00

printf “%x\n” 5624 将十进制转换成16进制

$ printf "%x\n" 5624
15f8

查看线程栈信息

$ jstack 5621|grep 15f8
"main" #1 prio=5 os_prio=0 tid=0x00007fe92c009800 nid=0x15f8 in Object.wait() [0x00007fe9341a3000]

    原文作者:czj1992czj
    原文地址: https://blog.csdn.net/czj1992czj/article/details/80290727
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞