Arthas使用小记


安装

下载arthas-boot.jar,然后用java -jar的方式启动:

curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar

或者去官网下载:https://arthas.aliyun.com/download/latest_version?mirror=aliyun

github: https://github.com/alibaba/arthas/releases

离线文档: https://arthas.aliyun.com/download/doc/latest_version?mirror=aliyun

然后解压,文件夹里面有 arthas-boot.jar

卸载

rm -rf ~/.arthas/
rm -rf ~/logs/arthas

启动

需要使用与待监控进程相同的用户来运行arthas

$ java -jar arthas-boot.jar
* [1]: 35542
  [2]: 71560 math-game.jar

选择2然后回车。

Arthas会attach到目标进程上,并输出日志:

[INFO] Try to attach process 71560
[INFO] Attach process 71560 success.
[INFO] arthas-client connect 127.0.0.1 3658

  ,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---.

 /  O  \ |  .--. ''--.  .--'|  '--'  | /  O  \ '   .-'

|  .-.  ||  '--'.'   |  |   |  .--.  ||  .-.  |`.  `-.

|  | |  ||  |\  \    |  |   |  |  |  ||  | |  |.-'    |

`--' `--'`--' '--'   `--'   `--'  `--'`--' `--'`-----'

wiki: https://arthas.aliyun.com/doc
version: 3.0.5.20181127201536
pid: 71560
time: 2018-11-28 19:16:24
$

命令

help 显示所有命令

dashboard 展示当前进程的信息,ctrl + C 中断执行

jad java.lang.String 反编译class

redefine d:\\nxjy\\jvm\\nxarthasDemo.class 热部署class类

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值