Arthas from Alibaba, is an online trouble-shooting tool.
No JVM restart, no additional code changes. Arthas works as an observer, that is, it will never suspend your running threads.
Launching Arthas:
$ java -jar arthas-boot.jar
Then select the application to be monitored.
Stop Arthas:
$ quit
or
$ exit
Basic Commands:
- dashboard command
$ dashboard
The
dashboard
command allows you to view the real-time data panel of the current system.
- thread command
$ thread 1
The
thread 1
command prints the stack of thread ID 1.Arthas supports pipes, and you can find
main class
withthread 1 | grep 'main('
.
- sc command
$ sc -d *MathGame
The
sc
command can be used to find the loaded classes in the JVM
- jad command
$ jad demo.MathGame
The
jad
command can be used to decompile the byte code
- watch command
$ watch demo.MathGame primeFactors returnObj
The
watch
command can view the parameter/return value/exception of the method.
params
refers to parameters
-x 2
means the print depth is 2
Reference
[1]. https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn