这里简单记录一下使用Arthas的使用命令,以便自己下次查找使用的时候,方便使用,因为官方的文档,默认使用的 github 的地址下载,所有有时候下载很慢。其它官方文档就很简单,主要是下载的链接不好。
第一步: 下载 及运行
curl -O https://arthas.gitee.io/arthas-boot.jar
java -jar arthas-boot.jar
第二步:
通过 watch 命令来查看 demo.MathGame#primeFactors 函数的返回值:
watch demo.MathGame primeFactors returnObj
查看入参
watch demo.MathGame primeFactors "{params,returnObj}" -x 2 -b
参考: