Official website address: https://arthas.aliyun.com/en-us/
Note: The demonstration here is demonstrated with the idea plugin
1. Idea install the arthas idea plugin
Click quick start,
click IDEA Plugin
idea to install the arthas idea plugin
2. Download arthas-boot.jar and allow, choose to specify java instance
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar
Three, view the attribute value of the object in the running java instance
After clicking, the command is
getstatic com.ctrip.wingon.frbs.common.GcHelper OS -x 3 The
execution effect is as follows
Fourth, the input and output of the monitoring function and exceptions
The command after clicking is
watch com.ctrip.wingon.frbs.common.GcHelper tryFullGc'{params,returnObj,throwExp}' -v -n 5 -x 3 '1==1' The
execution effect is as follows, you can clearly see the input , Output, abnormal index
Five, performance tracking
After clicking, the command is
trace com.ctrip.wingon.frbs.common.GcHelper tryFullGc -v -n 5 --skipJDKMethod false '1==1' The
execution effect is as follows, you can clearly see where the performance bottleneck is
to sum up
There are also viewing jvm information, generating headdump files, viewing stack information, data statistics, and so on. It is not shown here that
by using arthas, you can easily locate whether the code in production is executed or not. The execution value is How much, where is the performance bottleneck, what is the jvm information, etc.