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