Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

arthas

> AI 编程
Open source

Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas

37.5K stars0 likes6 views
WebsiteGitHub

About

Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas

Arthas

Arthas is a Java Diagnostic tool open sourced by Alibaba.

Arthas allows developers to troubleshoot production issues for Java applications without modifying code or restarting servers.

中文说明/Chinese Documentation

Background

Often times, the production system network is inaccessible from the local development environment. If issues are encountered in production systems, it is impossible to use IDEs to debug the application remotely. More importantly, debugging in production environment is unacceptable, as it will suspend all the threads, resulting in the suspension of business services.

Developers could always try to reproduce the same issue on the test/staging environment. However, this is tricky as some issues cannot be reproduced easily on a different environment, or even disappear once restarted.

And if you're thinking of adding some logs to your code to help troubleshoot the issue, you will have to go through the following lifecycle; test, staging, and then to production. Time is money! This approach is inefficient! Besides, the issue may not be reproducible once the JVM is restarted, as described above.

Arthas was built to solve these issues. A developer can troubleshoot your production issues on-the-fly. No JVM restart, no additional code changes. Arthas works as an observer, which will never suspend your existing threads.

Key features

  • Check whether a class is loaded, or where the class is being loaded. (Useful for troubleshooting jar file conflicts)
  • Decompile a class to ensure the code is running as expected.
  • View classloader statistics, e.g. the number of classloaders, the number of classes loaded per classloader, the classloader hierarchy, possible classloader leaks, etc.
  • View the method invocation details, e.g. method parameter, return object, thrown exception, and etc.
  • Check the stack trace of specified method invocation. This is useful when a developers wants to know the caller of the said method.
  • Trace the method invocation to find slow sub-invocations.
  • Monitor method invocation statistics, e.g. qps, rt, success rate and etc.
  • Monitor system metrics, thread states and cpu usage, gc statistics, and etc.
  • Supports command line interactive mode, with auto-complete feature enabled.
  • Supports telnet and websocket, which enables both local and remote diagnostics with command line and browsers.
  • Supports profiler/Flame Graph
  • Support get objects in the heap that are instances of the specified class.
  • Supports JDK 8+ in version 4.x, including JDK 17, JDK 21, and JDK 25.
  • Supports Linux/Mac/Windows.

Quick start

Use arthas-boot(Recommended)

Downloadarthas-boot.jar,Start with java command:

bash
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar

Print usage:

bash
java -jar arthas-boot.jar -h

Use as.sh

You can install Arthas with one single line command on Linux, Unix, and Mac. Copy the following command and paste it into the command line, then press Enter to run:

bash
curl -L https://arthas.aliyun.com/install.sh | sh

The command above will download the bootstrap script as.sh to the current directory. You can move it any other place you want, or put its location in $PATH.

You can enter its interactive interface by executing as.sh, or execute as.sh -h for more help information.

Documentation

  • User manual
  • Installation
  • Download
  • Quick start
  • Advanced usage
  • Commands
  • WebConsole
  • Docker
  • Arthas Spring Boot Starter
  • User cases
  • FAQ
  • Compile and debug/How to contribute
  • Release Notes

Feature Showcase

Dashboard

  • https://arthas.aliyun.com/doc/en/dashboard

Thread

  • https://arthas.aliyun.com/doc/en/thread

See what is eating your CPU (ranked by top CPU usage) and what is going on there in one glance:

…

jad

  • https://arthas.aliyun.com/doc/en/jad

Decompile your class with one shot:

…

mc

  • https://arthas.aliyun.com/doc/en/mc

Memory compiler, compiles .java files into .class files in memory.

bash
$ mc /tmp/Test.java

retransform

  • https://arthas.aliyun.com/doc/en/retransform

Load the external *.class files to retransform/hotswap the loaded classes in JVM.

bash
retransform /tmp/Test.class
retransform -c 327a647b /tmp/Test.class /tmp/Test\$Inner.class

sc

  • https://arthas.aliyun.com/doc/en/sc

Search any loaded class with detailed information.

…

vmtool

  • https://arthas.aliyun.com/doc/en/vmtool

Get objects in the heap that are instances of the specified class.

…

stack

  • https://arthas.aliyun.com/doc/en/stack

View the call stack of test.arthas.TestStack#doGet:

…

Trace

  • https://arthas.aliyun.com/doc/en/trace

See what is slowing down your method invocation with trace command:

Watch

  • https://arthas.aliyun.com/doc/en/watch

Watch the first parameter and thrown exception of test.arthas.TestWatch#doGet only if it throws exception.

bash
$ watch test.arthas.TestWatch doGet {params[0], throwExp} -e
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 65 ms.
ts=2018-09-18 10:26:28;result=@ArrayList[
    @RequestFacade[org.apache.catalina.connector.RequestFacade@79f922b2],
    @NullPointerException[java.lang.NullPointerException],
]

Monitor

  • https://arthas.aliyun.com/doc/en/monitor

Monitor a specific method invocation statistics, including the total number of invocations, average response time, success rate, and every 5 seconds:

…

Time Tunnel(tt)

  • https://arthas.aliyun.com/doc/en/tt

Record method invocation data, so that you can check the method invocation parameters, returned value, and thrown exceptions later. It works as if you could come back and replay the past method invocation via time tunnel.

…

Classloader

  • https://arthas.aliyun.com/doc/en/classloader
…

Web Console

  • https://arthas.aliyun.com/doc/en/web-console

Profiler/FlameGraph

  • https://arthas.aliyun.com/doc/en/profiler
bash
$ profiler start
Started [cpu] profiling
$ profiler stop
profiler output file: /tmp/demo/arthas-output/20211207-111550.html
OK

View profiler results under arthas-output via browser:

Arthas Spring Boot Starter

  • Arthas Spring Boot Starter

Known Users

Arthas has more than 120 registered users, View All.

Welcome to register the company name in this issue: https://github.com/alibaba/arthas/issues/111 (in order of registration)

Derivative Projects

  • Bistoury: A project that integrates Arthas
  • A fork of arthas using MVEL

Credits

Contributors

This project exists, thanks to all the people who contributed.

Projects

  • bytekit Java Bytecode Kit.
  • greys-anatomy: The Arthas code base has derived from Greys, we thank for the excellent work done by Greys.
  • termd: Arthas's terminal implementation is based on termd, an open source library for writing terminal applications in Java.
  • crash: Arthas's text based user interface rendering is based on codes extracted from here
  • cli: Arthas's command line interface implementation is based on cli, open sourced by vert.x
  • compiler Arthas's memory compiler.
  • Apache Commons Net Arthas's telnet client.
  • async-profiler Arthas's profiler command.

Issues· 488 open

View all issuesOpen on GitHub
  • #3272

    邀请 arthas 加入 GithubStarMate,让更多人发现你的作品

    Updated Sep 26, 2026
  • #3270

    thread 显示的线程ID 只能显示2位数字,长线程ID会被截断,导致不同线程出现相同ID,无法准确查看到堆栈细节

    Updated Sep 18, 2026
  • #2239

    线程相关信息超出tty 宽度时,信息会被隐藏,而不是换行

    Updated Sep 18, 2026
  • #3266

    Upgrade the bundled async-profiler to v4.5 to fix long JVM pauses when loading/attaching the profiler (async-profiler issue 1406)

    Updated Sep 8, 2026
  • #3251

    fix: replace printStackTrace with proper logging

    Updated Aug 26, 2026
  • #3257

    Potential Vulnerabilities Due To Hidden Dependencies

    Updated Aug 11, 2026
  • #2739

    使用Arthas 获取 Spring 应用运行时配置值

    user-caseUpdated Aug 7, 2026
  • #3246

    k8s 临时 debug 容器无法 attach 应用容器中的 Java 进程(跨 mount namespace)

    Updated Jul 21, 2026
  • #3238

    springboot整合arthas-tunnel-server

    Updated Jul 15, 2026
  • #3235

    多层agent使用arthas-spring-boot-starter反编译问题

    Updated Jul 10, 2026

> Tags

Javaagentalibabaarthasclassloader

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.