arthas常用命令(五)--heapdump 、jvm

发布时间 2023-06-25 23:59:32作者: 乐之者v

heapdump

heapdump , 类似 jmap 命令的 heap dump 功能。

  • dump 到指定文件。

arthas-output 是arthas 生成到项目中的文件。
dump.hprof 是自定义的 dump 文件名称。

[arthas@26028]$ heapdump arthas-output/dump.hprof
Dumping heap to arthas-output/dump.hprof ...
Heap dump file created
  • 只 dump live 对象
[arthas@58205]$ heapdump --live /tmp/dump.hprof
Dumping heap to /tmp/dump.hprof ...
Heap dump file created

jvm

  • 查看当前 JVM 信息
jvm

结果如下:

参考资料:

https://arthas.gitee.io/doc/dump.html
https://arthas.gitee.io/doc/heapdump.html