Arthas, the Java debugger that introduced Ali, was published in [Omg!! And a Java debug artifacts ~] (HTTP: / / http://mp.weixin.qq.com/s?__biz=MzIzMzgxOTQ5NA==&mid=2247504902&idx=1&sn=502b317b33ca6cc9aa7d0dbcf8463bc9& CHKSM = e8fd480fdf8ac119beeb9246ecee53ac56eac6787e9f4ba084215d2890be7e274233f9bf01c2 & scene = 21 # wechat_redirect).

~

Many students feedback that it is easy to use, but the command can not remember, so difficult oh

~

To be honest, command is more or less spoken, especially in advanced usage such as

Ognl, Watch, Trace, etc., are really hard to remember away from the document.

Is there something that can automatically generate command parameters for us? If there were, that would be great
In fact, the executives of Alibaba have long thought of this pain point of most developers, and they offer an automatic generation

IDEA plugin for arthas command, and is open source.

Official Address:

Github.com/WangJi92/ar…

Currently, both online and offline installation modes are supported.
With this plugin, you just need to place the cursor over a specific field, method, or class, right-click the command to execute, and some of the commands will pop up

Arthas console is ok.

An official picture shows just how powerful it is.

How to play it?

Let’s use the trace command to specify what this command does:

  • Performance optimization ~

  • This method is called, the specific process is what! You can see this by calling the chain.

  • You can view the stack of exceptions if there are exceptions

1. Select the function that you want to view performance and right click to bring up the arthas command panel, as shown below

2. Click the Trace command to copy the corresponding command to the clipboard

trace cn.javatiku.yp.admin.controller.IndexController getData -v -n 5 --skipJDKMethod false '1==1'
Copy the code

Arthas Server has started Arthas Server, and Telnet the Arthas Server to diagnose the process. For example:

Telnet 127.0.0.1 3658Copy the code

Here I directly use Xshell connection to avoid the problem of garbled characters, as shown in the picture below

In this way, you can see the specific performance analysis. In fact, I personally feel that the plugin is quite useful ~

You won’t be able to master Arthas from this example, but getting started is enough, and hopefully this article will help you get to grips with this debugging tool

! [](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/da31241b58e34e67b6ed9a5657959df0~tplv-k3u1fbpfcp-zoom-1.image)

Follow the hashtags below to find more similar articles
[

Java

](https://juejin.cn/tag/Java)