1. 现象
CPU占用100%
2. code
public class JStack {
public static void main(String[] args) {
while (true) {
//Do Nothing
}
}
}
3. 分析过程
a. top 所有进程--- c ---u --search propel
b.top -Hp 7057 指定进程的所有线程,找到cpu高使用率的线程
c. 线程id 转为16进制
d. jstack -l 7057 >> jstack.out
命令查看当前java进程的堆栈状态, 找到线程
Thread state 参考:https://www.jianshu.com/p/f4454164c017