先需要下载好 arthas工具:官网链接 https://github.com/alibaba/arthas/blob/master/README_CN.md

下载方式:curl -O https://arthas.aliyun.com/arthas-boot.jar  

运行 arthas:java -jar arthas-boot.jar

阿里开源 arthas 帮助命令一览表
命令命令描述中文描述
help Display Arthas Help查看命令帮助信息
keymapDisplay all the available keymap for the specified connection.Arthas快捷键列表及自定义快捷键
scSearch all the classes loaded by JVM查看JVM已加载的类信息
smSearch the method of classes loaded by JVM  查看已加载类的方法信息
classloaderShow classloader info查看classloader的继承树,urls,类加载信息
jadDecompile class反编译指定已加载类的源码
getstaticShow the static field of a class通过getstatic命令可以方便的查看类的静态属性
monitorMonitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc.方法执行监控
stackDisplay the stack trace for the specified class and method输出当前方法被调用的调用路径
threadDisplay thread info, thread stack查看当前线程信息,查看线程的堆栈
traceTrace the execution time of specified method invocation.  方法内部调用路径,并输出方法路径上的每个节点上耗时
watchDisplay the input/output parameter, return object, and thrown exception of specified method invocation  方法执行数据观测
ttTime Tunnel       方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测
jvmDisplay the target JVM information                查看当前JVM信息
perfcounterDisplay the perf counter infornation.           查看当前JVM的 Perf Counter信息
ognlExecute ognl expression.            执行ognl表达式
mcMemory compiler, compiles java files into bytecode and class files in memory.     Memory Compiler/内存编译器,编译.java文件生成.class
redefineRedefine classes. @see Instrumentation#redefineClasses(ClassDefinition...)  加载外部的.class文件,redefine jvm已加载的类。
dashboardOverview of target jvm's thread, memory, gc, vm, tomcat info.       当前系统的实时数据面板,按 ctrl+c 退出。
dumpDump class byte array from JVM          dump 已加载类的 bytecode 到特定目录
heapdumpHeap dump         dump java heap, 类似jmap命令的heap dump功能
optionsView and change various Arthas options              全局开关
clsClear the screen              清空当前屏幕区域
resetReset all the enhanced classes                                                                            重置增强类,将被 Arthas 增强过的类全部还原,Arthas 服务端关闭时会重置所有增强过的类
versionDisplay Arthas version输出当前目标 Java 进程所加载的 Arthas 版本号
sessionDisplay current session information 查看当前会话的信息
syspropDisplay, and change the system properties.            查看当前JVM的系统属性(System Property)
sysenvDisplay the system env.           查看当前JVM的环境属性(System Environment Variables)                                                      
vmoptionDisplay, and update the vm diagnostic options.查看,更新VM诊断相关的参数
loggerPrint logger info, and update the logger level  查看logger信息,更新logger level
historyDisplay command history                 打印命令历史
catConcatenate and print files   打印文件内容,和linux里的cat命令类似。
echowrite arguments to the standard output  打印参数,和linux里的echo命令类似。
pwdReturn working directory name       返回当前的工作目录,和linux命令类似
mbeanDisplay the mbean information                     查看 Mbean 的信息
grepgrep command for pipes.         类似传统的grep命令。
teetee command for pipes.类似传统的tee命令, 用于读取标准输入的数据,并将其内容输出成文件。
profilerAsync Profiler. https://github.com/jvm-profiling-tools/async-profiler使用async-profiler生成火焰图
stopStop/Shutdown Arthas server and exit the console.关闭 Arthas 服务端,所有 Arthas 客户端全部退出

 


文章最后,给大家推荐一些受欢迎的技术博客链接

  1. JAVA相关的深度技术博客链接
  2. Flink 相关技术博客链接
  3. Spark 核心技术链接
  4. 设计模式 —— 深度技术博客链接
  5. 机器学习 —— 深度技术博客链接
  6. Hadoop相关技术博客链接
  7. 超全干货--Flink思维导图,花了3周左右编写、校对
  8. 深入JAVA 的JVM核心原理解决线上各种故障【附案例】
  9. 请谈谈你对volatile的理解?--最近小李子与面试官的一场“硬核较量”
  10. 聊聊RPC通信,经常被问到的一道面试题。源码+笔记,包懂
  11. 深入聊聊Java 垃圾回收机制【附原理图及调优方法】

欢迎扫描下方的二维码或 搜索 公众号“大数据高级架构师”,我们会有更多、且及时的资料推送给您,欢迎多多交流!

                                           

       

 

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐