todo

arthas使用,获取实例,运行代码等

up:2025-04-10 11:17:29 edit:2025-07-08 05:00:23 view:210

faq

https://arthas.aliyun.com/doc/faq.html



1. 根据类获取实例并展示字段

vmtool -a getInstances --className java.lang.Thread -x 2 -l 3 --express 'instances[0].getClass()]

2. 查看cpu忙的线程

thread

thread 进程号 查看堆栈

3.  反编译类看代码和classloader

jad com.gd67.*.Main

4. 运行代码

ognl 'new java.util.Date()'

ognl '@String@class + ""'


5. 火焰图

profiler start

profiler stop [--format flat] 控制台看的话


6. 查看调用情况

watch org.apache.rocketmq.broker.BrokerController needRegister

TAGS: java jvm arthas

not in sinaapp