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]