[笔记]java分析内存

分析内存

1.jmap_dump

2.下载地址

https://www.ej-technologies.com/download/jprofiler/files

2.1JVM启动参数

-XX:+HeapDumpOnOutOfMemoryError-XX:HeapDumpPath=D:\heapdump

2.2jmap生成dump文件

文件名使用.hprof或者.bin都可以

jmap -dump:format=b,file= "D:\a.dump" 8632  //windows需要加引号

jmap -dump:live,format=b,file=a.log 18497

3.arthas

3.1官方下载

curl -O https://arthas.aliyun.com/arthas-boot.jar

java -jar arthas-boot.jar

3.2基础命令

dashboard 展示当前进程消息
thread [id] 查看线程id数据
select 参数可以指定进程名字

3.3火焰图参考示例

https://techlog.cn/article/list/10183631如果顶层出现平顶则可能存在性能问题。

posted @ 2022-12-05 17:26  tianliang7  阅读(31)  评论(0)    收藏  举报