2.基础指令

简介: ascascascsa

1.dashboard
输入dashboard,按回车/enter,会展示当前进程的信息,按ctrl+c可以中断执行

3.3.9

ne

TarthME101621ASHLCaTD

TINE

yElti

H150

3

esttoyLAvaW

SignalDispatchar

RUVMARLE

arthas-NettyhttofelnetBoototrap-3-1

false

arthas-uforstot

NAITING

tolse

TIMEDHAITING

folse

orthos.commond-execute

TIMEDTMAITING

false

arthas-shell-sErver

TIMEDMNIIINC

NALIING

Talse

arthas-timer

TIMEDHALLING

ralse

container-t

LWEL

false

Henor

heap

7.78

edenSR

survivorspace

tenuredgen

.08

q,narkgweepconpact.tine(ns)

nonheap

.07

95.37

0.52

conpressedelanpspace

1024N

00K

100.00%

direcT

08.直a日4

出222.7.865

n.weunin

jawa.wengion

jdk/jdki.D.16/jr

Jaya.hos

9.a1

ywiemLag.nWeLnJje


ID: Java级别的线程ID,注意这个ID不能跟jstack中的nativeID一一对应
NAME: 线程名
GROUP: 线程组名
PRIORITY: 线程优先级, 1~10之间的数字,越大表示优先级越高
STATE: 线程的状态
CPU%: 线程消耗的cpu占比,采样100ms,将所有线程在这100ms内的cpu使用量求和,再算出每个线程的cpu使用占比。
TIME: 线程运行总时间,数据格式为分:秒
INTERRUPTED: 线程当前的中断位状态
DAEMON: 是否是daemon线程
2.jad反编译指令
输入:jad + 文件全路径,如我想查看主启动类,则:

jadcom.arthas.ArthasApplication

arthas@30162]:

cLassLoader:

+ORGINGfRAMeWorkBo

sun.misc.auchersAppclassLoader@3deac69

sun.misc.achExtclassLoader?589b3632

Location:

fiLe:/opt/software/arthas/Arthas.jar!/BOO-INF/cLasse

DecompiledwithCFR.

Couldnotloadthefoilowingclasses:

org.springframework.boot,pringppication

org.springframework.boot.utconuriotication

packagecom.arthas

importorg.springframework.boot.ringpicatin

importorgspringframework.boot.utoconigurioictio

@SpringBootapplication

publicclassArthasApplication

main(Stringllargs)

publicstaticvoidm

Springapplicationunthpplicationi

Affect(row-cht:2)costin1563ms


3.thread
最忙的前N个线程并打印堆栈

arthas@30162]sthread-n3

cpuusage-100%RUNNABLE

arthas.command-execute"Id-37couusao

atsun.management.Threadmpl.dumhatih

atsun.management.threadmgehohema

stCo:Bt.mom

tComtabbab.rthorm

stCo.B

stoomobw.artb.om.mao.

可GbaarmiAoemmmmwmwm.

tteo.obboat.oeshaom.mmmm

tComtiba.rth.o

atjava.utt.cocurent.xuoexc)

atjava.uti.concut.uturaku(uturak

uboewd.otym.thmuomoloomowcomoo

ajoautt.oa.hoamerooomooom

atjoya.uti.cocut.xuxu

tjvautiukco)

atjava.lang.thread.run(Thread.java:748)

"RefeRenceHander2CAN

atjava.lang.objectwaittiMtod)

waltingonjava.ang.ef.ReferencesLock@40106a68

atjava.lang.object.waitjct.ja:

atjaya.lang.re.frence.tryHaddingencea

jaya.ang.ferenceteferenceHandLer.runeferenceJava:153)

TFLotzerLd3coulse-0WATiNyk

atjava.tang.objectwittio)

waitingonjava.ag.ck

atjaya.tang.e.eferenceoueue.removeefrenceoueuejaya;143)

atjava.lang.rencequeuencueay)

dtjaya.lang..aizi(n


所有线程的信息

器222中

HIMEDHAITIMG

aoaaoccoooacccoooacccoooc

HAITING

WAITING

ANAERAEREH.TELNETBOTSTIEN

BURNIAELI

RTIHAFL

Arthas-NenyhttprelnetBootstrap-.3-2

arthas-userStat

AITING

TIMED_WAITING

svsten

arthas.shell-server

NIMED_WAIIIN

container-0

hopnion.i.e.amnnaacteplm

httpnoe.0.0.0.m0oBlnckPollor

3188888

WAITINc

WALIING

HAITING

KAITING

NIOOO08O

HATTTNG

WAITING

N9

WAITING

http-n10-0.0.0.0-8090xec.

PN

WALIING

http-n10-0.0.0.0-80802xcc

WA开I限

http-n1o-0.0.0.0-8030xec8

http-nio-0.0.0.0-0080erfc9


指定线程的运行堆栈
如上有线程ID为37的,所以这里指明id=37

[arthas@301621thread37

"arthas-command-execute"Id-37RUNNABLE

atsun.management.threadmp.dumphradtihd)

atsun.management.Threadmp.gehd(hm

tCou.tobi.t..

atCotm

afConabbb.wm

ttdHawa.artt.oom.mmcm

tEo.tBbBCa.m

tGMabbbattit.o8.om.moomm.

atcomBbagt

atjava.utit.cocurent.xecutorsskumaeder.u

atjava.uti.concurentFuturfaskuuueask.a;

mbmdom.oooouoaomo

ajovawtt.oarem.mom

atjavautit.cocurent.uk

atjayauttoxukxuo)

atjava.tang.Thread.run(Thread.java:748)


当前阻塞其他线程的线程
无阻塞返回

[arthas@30162]$thread

Nomostblockingthreadfound!


有阻塞返回
注意, 目前只支持找出synchronized关键字阻塞住的线程, 如果是java.util.concurrent.Lock, 目前还不支持。
指定采样时间间隔

arthas@30162sthreadn3-11000

"arthas.command-executeld-37couusage-493RUNNABLE

atsun.management.hreadm.dumhredth

atsun.management.Tradml.gtheadnfo(hedmla4

afGoma.tmo

tComtaobag.rth.m.

atComb

utCoLbbB.m

t0bwooatwb.oeime

tobwooamboeme

utComabbag..

atjaya,util.concurent.xccutorsskualed.cuo)

atjava.uti.cocutuuu(uuaka

aoduTL.Cmuret3thauametraltohaaakomo

afbovauitomotthoomroteuossthuckmm

utv.utLou

atJovouttt.nu)

atjava.lang.Thread.run(Thread.java:748)

而w地

atsun.misc.unsate.park(NativeMethod)

watingojavautiut

atjaya.utit.conurnt.kkt

obwtt.otumemoh.htooowwom

AAtDS.Sooamo

sto.ut.wme.themoom

tJava.t.exuou

atjava.uttu

atjova.utit.cnuren.u)

torg.apathe.tomat.ut.

atjava.lang.Thread.run(Thread.java:748)

http:o000okt)

otsun.nio.ch.r.t

atsun.nlo.ch

atsun.nio.ch.Pmm

atsun.nio.chelectolmlkem

atsun.nio.chlcomcoma

torg:.path.totu


查看指定状态的线程
thread –state
状态:[RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, NEW, TERMINATED]

INE

WATTTNC

Q:

WAITING

0000080006000

WAITING

WALLING

WAITING

WATTING

HATTTNG

EH电3

WAITING

WAITING

WAWEINE

HATTTNG

hopnipo.0.0.0nanocacc6

WAITING

1中01.0.0.0.086600米4c-7

WAITING

true

http-n10.8.0.0.08080ex9c-8

3:U

WALIING


4.watch
查看方法耗时出参
如我有这样一个方法:

com.arthas.controiler;

package

importorg.springframework,steeotype.Controiler;

importorg.springframework.web.bindaottioneuestMaping

importorg.springframework.web.bindantationeoedy;

**

@authoryouzhaxiaobo

Qversion1.0

Ddate2020/8/1809:14

QDesc

*

@Controiler

publicclassArthasController

@RequestMapping(value

Itest")

@ResponseBody

publicstringarthasTeststringkey)

returnKey;


则指令为:

tarthasos01621watchcomarthas.controteontht

PressoorCtrl+Ctoabort.

Affect(classcount:,methodcount1)c

costin56msisteneId:2

result-@stringthelto]

ts-2020-08-1816:08:27;[cost-0.048968ms]

ts-20200-1816:08:32;[cost-0.036844ms]

result-@string[您好]


查看指定方法入参出参

Shell

运行代码复制代码

1

watch com.arthas.controller.ArthasController arthasTest "{params,returnObj}" -x 2

arthas@10999]

returnob

watchcom.athas.cotohe

params

Pressoorctrl+Ctoabort.

Affect(classcout:1.hu

t2020-08-1911:0:9;

@Objectul

@Stringthello]

@String[hello]

resultoarraylist

ts-2020-08-1911:05:47;[cost-0.072623ms]

@objectul

string[您好

@String[您好],


观察异常信息

arthasq1099915

vatchcom.arthas.contollerordercontrollerbinThread

@],throwExp

PressoorCtrl+cto

L+Ctoabort.

Aftect(classcount:,mthodcount:coie

t2020081911:09:1;tcost13

@Integer[14393],

avan.emoryror:unabletcreatth

alJavd.lang.thread.starte(NativeHlethod)

atjava.tang.thread.start(Thread.java:717

atcom.arthas.controterdton

atsunretectthcck

dtsun.eflect.tveethouccesolmp

atsun.etectetmhc

atjaya.anglctthoh

可可3mb0.hm.m.m

uQspmrawoko.mo.

叫d.oo

的种地心的心).聊.

0心

a0gprmgtateokwo.omm

utogpwgraioik.evec

torgspringfanwoke..

atog.ptwganoikeb.et

atoRg.3Plmgoke

atjavax,servlet.http.tpservet.ceerlet.)

tD3Plgmok

atjayax.servlet.httpttpservletce

atop.pm.tlm.ootoiom

torg.apathc.atatm

torg.apuche.ocoteock

atog.asthccaatmotm.

tog.cpidie.eaalma.ore.platmitem

tQpsprwtaiprkswo.htcm


5.退出Arthas
如果只是退出当前的连接,可以用quit或者exit命令。Attach到目标进程上的arthas还会继续运行,端口会保持开放,下次连接时可以直接连接上。
如果想完全退出arthas,可以执行stop命令。

1 人点赞

1

油炸

相关文章
|
19天前
|
云安全 弹性计算 人工智能
2026年阿里云服务器租用价格:包年、包月、按量付费收费标准与活动价格
2026年阿里云服务器租用价格全面优化:轻量应用服务器低至38元/年,ECS年付99元起;包月灵活如香港地域24元/月;按量付费精确到秒。新用户专享秒杀、组合购省30%、续费同价及百万扶持资金,高性价比满足个人建站、企业上云与AI开发多元需求。
408 4
|
1月前
|
编解码 JavaScript 安全
二维码生成器 在线工具分享
一款基于Vue开发的在线二维码生成器,无需安装、不传数据,所有操作在浏览器本地完成。支持网址、文本、电话等多类型内容,实时预览、自定义尺寸/容错/颜色,一键下载高清图。隐私安全,手机电脑皆可用。
344 13
|
14天前
|
人工智能 自然语言处理 大数据
零基础从0到1学GEO优化第5课:怎么优化内容,让生成式引擎收录?
GEO核心是内容优化:通过结构化、语义清晰、权威可信的内容,让AI读懂并引用;优化四维度:结构、语义(语言)、权威(证据链)、意图(用户问题);关键提醒:无需官网/技术,通过多平台分发+结构化表达即可,重点是“解决用户问题”。
|
5月前
|
Java 项目管理 Maven
Maven项目管理与构建自动化完全指南
Maven彻底改变了Java项目管理方式,通过POM模型、依赖管理和标准化构建流程,大幅提升开发效率。本文深入解析其核心概念、多模块管理、私服搭建及与Spring Boot、Docker等现代技术栈的集成实践,助力开发者实现高效、规范的项目构建与团队协作。
949 156
Maven项目管理与构建自动化完全指南
|
人工智能 前端开发 算法
【2023五福】创新科技与传统年俗的有机融合 - AI 年画
23 年兔年,五福项目将传统的写福字升级成了年画,用户通过绘制兔子轮廓可以得到活动的兔子,同时由 AI 生成对应的兔子年画,整个过程给用户带来很强的惊喜感,同时将具有传统氛围的年画与科技感拉满的 AI 作图有机结合,为大家带来全新的年俗体验。AI 年画作为 23 兔年五福的创新项目,在玩法和技术方案上都采用全新的实现,前后端技术、AI 算法深度,以及美术互动等深度协同,实现了玩法了技术的双创新,最
【2023五福】创新科技与传统年俗的有机融合 - AI 年画
|
移动开发 Python
综合评价法之秩和比法RSR
介绍秩和比法的应用,及其代码实现
1746 0
综合评价法之秩和比法RSR
|
前端开发 JavaScript 中间件
阿里开源:Dawn - 基于「中间件和 Pipeline」的自动化构建工具
  Dawn 取「黎明、破晓」之意,原为「阿里云·业务运营团队」内部的前端构建和工程化工具,现已完全开源。它通过 pipeline 和 middleware 将开发过程抽象为相对固定的阶段和有限的操作,简化并统一了开发人员的日常构建与开发相关的工作。   采用中间件技术,封装常用功能,易于扩展,方便重用支持 pipeline 让多个 task 协同完成构建任务简单、一致的命令行接口,易于开发人员使用支持基于「中心服务」管理中间件和工程模板支持搭建私有中心服务,并统一下发构建规则,易于团队统一管理   依赖的环境、软件及其版本:   Node.js v7.6.0 及以上版本Mac/Linu
753 85
|
Linux 芯片
Linux驱动开发——物理地址映射(①)
Linux驱动开发——物理地址映射(①)
938 0
Linux驱动开发——物理地址映射(①)
|
SQL JSON 供应链
【墨菲安全实验室】Apache IoTDB grafana-connector模块SQL注入分析
【墨菲安全实验室】Apache IoTDB grafana-connector模块SQL注入分析
【墨菲安全实验室】Apache IoTDB grafana-connector模块SQL注入分析

热门文章

最新文章