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

油炸

相关文章
|
Web App开发 存储 关系型数据库
|
9月前
|
人工智能 弹性计算 安全
OpenClaw有什么用?本地/阿里云部署+百炼集成+个股分析实战盈利及避坑指南
你是否早已厌倦AI仅能“纸上谈兵”——写方案、改文字却无法落地执行?真正的AI生产力,应该是你设定目标,它全程闭环完成。OpenClaw(Clawdbot)作为首个开源本地部署的AI Agent平台,彻底打破了这一局限:它不是聊天机器人,而是能自动抓取新闻、分拣邮件、监控代码、甚至搭建个股分析模型的“数字员工”,连接飞书、微信等20+平台,数据全程本地化,完全开源可定制。
1314 160
|
12月前
|
canal 缓存 关系型数据库
|
12月前
|
负载均衡 算法 Java
|
12月前
|
缓存 Java 关系型数据库
|
12月前
|
Java 数据库连接 调度
|
9月前
|
机器学习/深度学习 SQL 人工智能
自然语言查数技术路线对比:本体神经网络如何实现企业级精准问数
本文剖析NL2SQL、RAG、预制指标与本体神经网络四大技术路线,指出后者(Palantir、UINO采用)以ABC范式实现高准确率(95%+)、线性维护成本、跨库多模态精准问数,真正支撑企业级智能分析。
|
9月前
|
人工智能 文字识别 自然语言处理
AI 英语朗读 APP的功能
这是一款深度融合音素分析、情感合成与个性化反馈的AI英语朗读APP,支持70+口音、OCR扫描、实时纠音、AI摘要测验及24小时AI陪练,专为高效口语提升与沉浸式学习设计。(239字)
|
9月前
|
云安全 弹性计算 人工智能
2026年阿里云服务器租用价格:包年、包月、按量付费收费标准与活动价格
2026年阿里云服务器租用价格全面优化:轻量应用服务器低至38元/年,ECS年付99元起;包月灵活如香港地域24元/月;按量付费精确到秒。新用户专享秒杀、组合购省30%、续费同价及百万扶持资金,高性价比满足个人建站、企业上云与AI开发多元需求。
1354 4