arthas使用

arthas中文文档

https://github.com/alibaba/arthas/blob/master/README_CN.md

1、下载并启动

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

2、选择java进程

[INFO] JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre
[INFO] arthas-boot version: 3.7.2
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 56740 org.jetbrains.jps.cmdline.Launcher
  [2]: 551 
  [3]: 55176 com.intellij.idea.Main
  [4]: 54649 com.XXX.XXX.XXX.XXXApplication
  [5]: 54474

输入

4

3、dashboard

查看jvm进程信息

[arthas@57016]$ dashboard

4、查看指定线程信息

thread pid

5、使用jad查看源码

[arthas@57016]$ jad com.XXX.XXX.XXX.XXX.service.XXXServiceImpl

6、查看指定方法返回值

watch 类全路径 方法名 returnObj

7、启动分析器

[arthas@57016]$ profiler start
Profiling started
[arthas@57016]$ profiler stop
OK
profiler output file: /User/businessProjects/xxx/arthas-output/20240513-190211.html

打开指定路径下的html

posted @ 2024-05-13 19:03  使用D  阅读(34)  评论(0编辑  收藏  举报