美文网首页
arthas使用

arthas使用

作者: 化蝶飞618 | 来源:发表于2021-12-27 16:09 被阅读0次

安装

  • 第一步:下载arthas 安装jar包
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar

日常使用命令

详细参考:https://arthas.aliyun.com/doc/en/commands.html

trace

  • 作用:跟踪方法调用路径,并输出路径中每个节点的时间开销。
    trace:命名名称
    demo.MathGame:类名全路径
    run:方法名称
    '#cost>2':条件(耗时大于2毫秒)

  • 查看耗时大于2毫秒的调用

trace demo.MathGame run '#cost>2'
  • 只查看第一条
trace demo.MathGame run -n 1
  • 线下jdk方法调用
trace --skipJDKMethod false demo.MathGame run

thread

  • 查看当前有哪些线程
thread
  • 根据具体的线程id查看线程信息
thread 1
  • 查看当前有哪些阻塞的线程
thread -b
  • 计算最后1000毫秒的线程cpu时间
thread -i 1000
  • 列出1000毫秒内最繁忙的3个线程堆栈
thread -n 3 -i 1000

jad

反编译指定的类

  • 反编译指定类
- 反编译指定类的方法
jad demo.MathGame
jad demo.MathGame main

monitor

监控方法调用

  • 5次调用,监控成功和失败次数
monitor -c 5 demo.MathGame primeFactors
  • 5次调用,监控成功和失败次数,筛选条件是第一个参数小于等于2的情况
monitor -c 5 demo.MathGame primeFactors "params[0] <= 2"

jvm

查看jvm详细信息

sysprop

检查目标JVM中的系统属性

vmoption

显示并更新vm诊断选项

相关文章

  • 如何使用Arthas提高日常开发效率?

    Arthas有什么功能,怎么用,请看:Arthas使用手册[https://arthas.aliyun.com/d...

  • Arthas-Java排查神器使用

    推荐使用arthas-boot.jar方式 1、下载及安装 arthas-boot是Arthas的启动程序,它启动...

  • arthas源码分析

    arthas简介 arthas 是Alibaba开源的Java诊断工具,基于jvm Agent方式,使用Instr...

  • 排查线上CPU飙高

    1、本案例的排查过程使用的阿里开源的Arthas工具进行的,不使用arthas,使用JDK自带的命令也是可以。 2...

  • 超好用的自带火焰图的 Java 性能分析工具 Async-pro

    最近 Arthas 性能分析工具上线了火焰图分析功能,Arthas 使用 async-profiler 生成 C...

  • Arthas使用

    下载arthas-boot.jar: 然后用java -jar的方式启动: 选择一个pid进入(如1): 通过th...

  • Arthas使用

    1、写作背景 在此记录,以备遗忘 2、核心操作 2.1、Arthas安装 linux安装 wget https:/...

  • Arthas使用

    Authas — 开源的java诊断工具 下载安装 authas是一个jar包,可以直接下载后运行 就可以启动起来...

  • Arthas使用

    1.代码热修复:jad --source-only com.test.demo.dmp.constant.DmpC...

  • arthas使用

    安装 第一步:下载arthas 安装jar包 日常使用命令 详细参考:https://arthas.aliyun....

网友评论

      本文标题:arthas使用

      本文链接:https://www.haomeiwen.com/subject/mutknltx.html