用 arthas 来分析异常进程
arthas使用参考: https://arthas.aliyun.com/doc/quick-start.html
使用和目标进程一致的用户启动,否则可能 attach 失败
1 | sudo -u hbase env PATH=$PATH java -jar arthas-boot.jar |
1 | dashboard |
运行 dashboard 命令回车,就可以查看该进程占用资源的总体情况
1 | thread -n 3 |
输出资源占用前三名的线程
通过 thread 命令来获取到进程的 Main Class
1 | $ thread 1 | grep 'main(' |
通过 jad 来反编译 Main Class
1 | $ jad demo.MathGame |