1、下载

# github下载
wget https://alibaba.github.io/arthas/arthas-boot.jar
# 或者 Gitee 下载
wget https://arthas.gitee.io/arthas-boot.jar

2、快速使用

(1)需要排查的进程

ps -ef|grep '线程名'

(2)进入arthas界面

java -jar arthas-boot.jar 53739

arthas初步使用

 

 3、几个比较好用的命令

3.1 看板

dashboard(系统看板):可以查看系统线程、jvm、gc情况,快速查看系统异常情况

arthas初步使用

 

 

 

 3.2 thread

快速定位系统死循环

thread -n 10:查找系统前10个耗cpu的线程

arthas初步使用

 

 

 thread:查看所有线程

arthas初步使用

 

 

thread 线程号:查看线程堆栈

 arthas初步使用

 

 thread -b查看线程block情况

3.3 jad反编译

希望查看线上代码是否正确,可以使用jad反编译class,查看java代码

jad aiinterview.AudioSession

arthas初步使用

 

 

3.4 ognl查看线上实时变量情况

可以替代日志,快速查看问题

比如要查看某个map容器中的情况

arthas初步使用

 

 3.5 trace查看线上方法耗时情况

arthas初步使用

 

 3.6 watch直接观测方法的入参出参

 arthas初步使用

 

相关文章:

  • 2021-10-11
  • 2021-12-02
  • 2021-05-10
  • 2021-08-09
  • 2021-09-12
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2021-11-07
  • 2021-07-29
  • 2021-10-09
  • 2021-04-21
相关资源
相似解决方案