introduce

Alibaba some time ago open source internal use of Java diagnostic tools, praise constantly. Recently featured on Github Trading, Arthas can help us solve some of these problems.

role

Arthas can help you when you are stuck with a problem like the following:

  1. From which JAR is this class loaded? Why are all kinds of class-related exceptions reported?
  2. Why didn’t the code I changed execute? Did I not commit? Got the branch wrong?
  3. If you encounter a problem, you cannot debug it online. Can you only re-publish it by logging?
  4. There is a problem with a user’s data processing online, but it cannot be debugged online, and it cannot be reproduced offline!
  5. Is there a global view of the health of the system?
  6. Is there any way to monitor the real-time health of the JVM?

Arthas supports JDK 6+, Linux/Mac/Windows, command line interaction, and rich Tab auto-completion to further locate and diagnose problems.

It’s super easy to troubleshoot online problems

You can see the state of the system as a whole, and which threads occupy the most CPU

jad

Decompiling the class class is super convenient

sc

Find classes that are already loaded in the JVM

Trace

See how the method is called and which parts are time-consuming

Watch

Observe the input arguments executed by the method and output only when the method throws an exception.

Monitor

Monitor call statistics for a particular method, including total calls, average RT, success rate, and so on, every 5 seconds.

Time Tunnel(tt)

Record method call information, support to view method call parameters, return values, thrown exceptions and other information, as if through the space-time tunnel back to the call site.

Classloader

Knowing how many classloaders are currently on your system and how many classes are loaded by each can help you determine if there is a classloader leak.

Of course, there are many other features that are particularly interesting. There are Chinese documents, written in detail, and many Chinese Internet companies use this tool