栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

使用arthas采集火焰图

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用arthas采集火焰图

火焰图是用图形化的方式来展现profiler工具采集的性能数据,对数据进行统计和分析,方便找出性能热点。

现在我们使用arthas采集JVM的火焰图。

1.首先你需要安装arthas

说是安装其实就是下载解压,arthas是不需要安装的。

下载 — Arthas 3.5.5 文档

需要完整的文件目录例如:

需要注意  如果你只是上传一个arthas-boot.jar是不够的,因为会调用其他库

#unzip arthas-packaging-3.5.4-bin.zip
#java -jar /home/profiler/arthas/arthas-boot.jar

2.启动arthas

先查你的Java进程id,查Java进程可以通过

#jps -l

启动arthas

#java -jar /home/profiler/arthas/arthas-boot.jar

定位到你需要的Java进程,输入你的Java进程id

$ profiler start
Started [cpu] profiling
$ profiler getSamples
25
$ profiler status
[perf] profiling is running for 21 seconds
$ profiler stop --format html
OK
输出文件格式

profiler stop --format html --file /home/profiler/arthas/20211230-1540.html

推荐输出图像格式
profiler stop --format svg --file /home/profiler/arthas/20211231-1111-atms.svg

点开性能损耗严重的地方可以看放大的详情图 


 

 

 参考:profiler — Arthas 3.5.5 文档

JVM那点事—火焰图(flame graph)性能分析 - 简书

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/686640.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号