Arthas笔记

Arthas 是Alibaba开源的Java诊断工具,github地址

Thread命令

使用线程ID查看线程状态

1
thread 100

查看排名TOP5的线程

1
thread -n 5

thread命令支持管道

1
thread -n 100 | grep 'main'

SC命令

使用匹配模式查找已经加载的类

1
sc -d *TranslateListener

1
2
3
4
5
```
#### JAD
根据类名反编译代码
```jshelllanguage
jad java.util.ArrayList
1
2
3
4
5
6
```

#### WATCH
查看指定方法的返回值
```jshelllanguage
watch java.util.ArrayList.forEachRemaining primeFactors returnObj