调用图callgraph分析
调用图 call graph 分析
arthas
简介: Arthas由阿里巴巴开发并开源,Java诊断工具,旨在帮助开发者和运维人员解决Java应用程序的性能问题。它提供了丰富的诊断功能,包括实时查看方法调用、查看类加载情况、监控方法执行耗时、查看线程堆栈、查看JVM各种指标等。
仓库地址:https://gitee.com/arthas/arthas
下载arthas-boot.jar,然后用java -jar的方式启动:
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar
常用命令
thread
:查看Java线程信息。
profiler start
:查看方法执行耗时。
profiler status
:查看当前的执行情况。
profiler stop
:停止方法执行耗时的分析。
watch
:监控方法。
watch com.example.MyClass myMethod "{params, target, returnObj}" -n 3
com.example.MyClass
类中myMethod
方法的执行情况,显示参数、目标对象和返回值,每次执行3次后停止。
trace
:动态跟踪方法。
trace com.example.MyClass myMethod
com.example.MyClass
类中myMethod
方法的调用链。
classloader
:查看类加载信息。
dashboard
:查看JVM内存信息。
logs
:查看实时日志