2017 June 21 java高CPU占用的排查 通过ps auxw --sort=-%cpu或top命令查看各个进程CPU使用率。 通过ps -mp pid -o THREAD,tid,time命令查看线程列表。 在线程列表中找到CPU占用高并且持续时间长的TID。 将需要的线程ID转换为16进制格式printf "%x\n" tid。 通过jstack pid |grep tid -A 30命令打印堆栈信息,找到出问题部分代码。