1. 安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| curl -L https://alibaba.github.io/arthas/install.sh | sh
rm -rf ~/.arthas/
./as.sh
./as.sh <PID>@[IP:PORT]
sc *$class_name
sm $full_class_name
watch $full_class_name $method_name "{params,target,returnObj}" -x 2 -b -s
trace -j $full_class_name $method_name '#cost > 10'
quit
shutdown
|
2. FAQ
2.1. Error during processing the command: null
出现该提示, 表示 java-agent 冲突了
已经存在其他使用 java-agent 配置了, 导致 arthas 无法 trace, watch.
如果要 arthas 正常使用, 必须禁止其他 java-agent 存在
3. Resource