当前位置:网站首页>Arthas Xiaobai beginner
Arthas Xiaobai beginner
2022-07-20 22:25:00 【Peipei Dad】
background
The project is running , Whether it is running in the expected way , Memory and CPU The occupancy of , Thread count and so on , How to monitor and view .
At this time, ordinary people will look for operation and maintenance , Now there are open source - arthas.
Arthas Data presentation
Arthas explain
Arthas yes Alibaba Open source Java Diagnostic tools , Loved by developers .
When you encounter the following similar problems and are at a loss ,Arthas Can help you solve :
Where does this class come from jar Package loaded ? Why do you report all kinds of related Exception?
Why didn't I change the code to ? I didn't commit? The branch is wrong ?
I can't get online when I have a problem debug, Can't we just add logs and redistribute them ?
There is a problem with the data processing of a user online , But online also can't debug, It can't be reproduced offline !
Is there a global perspective to see the health of the system ?
Is there any way to monitor JVM The real-time running state of ?
How to quickly locate the hot spot of application , Generate flame chart ?
How to directly from JVM Find an instance of a class in ?
Arthas Support JDK 6+, Support Linux/Mac/Windows, Use command line interaction mode , At the same time, it provides rich Tab Automatic completion function , Further facilitate problem location and diagnosis .
Project address :https://gitee.com/arthas/arthas
1、 Download the package and run it
wget https://arthas.aliyun.com/arthas-boot.jar
Start command :
java -jar arthas-boot.jar
arthas-boot yes Arthas Start up procedure for , When it starts up , Will list all Java process , The user can select the target process to be diagnosed .
Select the first process , Input 1 , Again Enter/ enter :
If you want to select the second process , Input 2, Again Enter/ enter :
... ...
And so on ( Monitor only one program at a time , Don't be greedy )
Attach After success , prints Arthas LOGO. Input help You can get more help information .
2、 Kanban Dashboard
dashboard Command to view the real-time data panel of the current system .
Input Q perhaps Ctrl+C You can quit dashboard command .
3、Thread
thread 1 The command prints the thread ID 1 The stack .
Arthas Support piping , It can be used thread 1 | grep 'main(' Find the main class.
You can see main class yes demo.MathGame:
$ thread 1 | grep 'main('
at demo.MathGame.main(MathGame.java:17)
4、Sc
Can pass sc Command to find JVM Class loaded in :
sc -d *MathGame
5、Jad
Can pass jad Command to decompile the code :
jad demo.MathGame
6、Watch
adopt watch Command can view the parameters of the function / Return value / Abnormal information .
watch demo.MathGame primeFactors returnObj
Input Q perhaps Ctrl+C sign out watch command .
7、Vmtool
adopt vmtool command , You can search memory objects .
vmtool --action getInstances --className java.lang.String --limit 10
bash
$ vmtool --action getInstances --className java.lang.String --limit 10
@String[][
@String[com/taobao/arthas/core/shell/session/Session],
@String[com.taobao.arthas.core.shell.session.Session],
@String[com/taobao/arthas/core/shell/session/Session],
@String[com/taobao/arthas/core/shell/session/Session],
@String[com/taobao/arthas/core/shell/session/Session.class],
@String[com/taobao/arthas/core/shell/session/Session.class],
@String[com/taobao/arthas/core/shell/session/Session.class],
@String[com/],
@String[java/util/concurrent/ConcurrentHashMap$ValueIterator],
@String[java/util/concurrent/locks/LockSupport],
]
8、Exit/Stop
sign out Arthas
use exit perhaps quit Command can exit Arthas.
sign out Arthas after , You can also use... Again java -jar arthas-boot.jar To connect .
To withdraw completely Arthas
exit/quit The command simply exits the current session,arthas server Still running in the target process .
Want to quit completely Arthas, It can be executed stop command .
Basically master the above common commands , You can kill a lot of development . Promotion and raise are just around the corner !
Most of the above content comes from official documents , If you are interested, you can take a look at it yourself .
Reference resources :Arthas User documentation — Arthas 3.6.2 file
边栏推荐
猜你喜欢
集群时钟同步配置
创意:现代艺术佚名油画AI作品呈现
The most complete idea debug debugging skills in history (super detailed cases)
Deep decryption of go language context
攻防世界----ics-05
[swoole series 2.5] asynchronous tasks
免费看知乎盐选
微信小程序应用开发(一)
[IEEE publication] 2022 International Conference on natural language processing and information retrieval (ecnlpir 2022)
Jenkins持续集成入门到精通
随机推荐
软件测试技术之项目上线流程
从数学推导开始,7万字一定带你学会支持向量机(免费PDF下载)
(cvpr2020)Learning texture transformer network for image super-resolution论文阅读
有关黄金k线图的知识和位置理论
【Swoole系列2.5】异步任務
完善镜像站配置信息 — 镜像站体验官
免费看知乎盐选
EMQ映云科技成功入选《中国企业家》2022年度「新锐100」榜单
如何用Redis实现消息的发布和订阅?实现原理又是什么?
页面请求拦截
DNS域名解析服务
聚合支付满足各行业接入多种支付
Hill sort summary
(JS)不使用辅助空间找出数组中唯一成对的数
Kubernetes cluster environment construction
MES管理系统解决方案的参照标准是什么
可以 DIY 装修的商城系统,你也能拥有!
Starting from mathematical derivation, 70000 words will definitely take you to learn support vector machine (free PDF download)
EVE-NG Lab模拟器 Cisco、H3C试验主机别名
xml转voc,voc转coco,coco转yolo,coco划分,coco检查,yolo检查,coco可视化