@toc
基本用法
: heapdump options <file-path>
参数说明:
参数名称 | 参数说明 |
---|---|
--live | 只包含活动对象(Live Objects),这通常意味着排除已经被垃圾回收器标记为不可达的对象。 |
--format | 指定输出文件的格式,默认为 |
-s | 跳过那些在 finalizer 队列中的对象。 |
--compress | 压缩输出文件。 |
--exclude-class | 排除特定类的对象,可以多次使用以排除多个类。 |
--include-class | 只包含特定类的对象,可以多次使用以包含多个类。 |
--exclude-package | 排除特定包名下的所有类的对象。 |
--include-package | 只包含特定包名下的所有类的对象。 |
--exclude-instance | 排除特定实例,可以通过 |
--include-instance | 只包含特定实例,可以通过 |
/tmp/heapdump.hprof
基础语法
: heapdump --live 指定输出的路径及文件名
heapdump --live /tmp/heapdump.hprof
基础语法
: heapdump --live --include-class=指定类的全路径 --format=指定输出文件的格式
[arthas@24056]$ heapdump --live --include-class=com.hero.lte.ems.sysmanager.cache.AmNeRefCache --format=bin /temporary/tmp1/AmNeRefCache.bin
Dumping heap to --include-class=com.hero.lte.ems.sysmanager.cache.AmNeRefCache ...
Heap dump file created
[arthas@24056]$
heapdump
命令会消耗一定的系统资源,特别是在大型应用程序中,因此在生产环境中使用时要格外小心。help heapdump
命令查看详细的帮助信息。2.Arthas dashboard(当前系统的实时数据面板)
3.Arthas thread(查看当前JVM的线程堆栈信息)
5.Arthas sysprop(查看和修改JVM的系统属性)
7.Arthas vmoption(查看和修改 JVM里诊断相关的option)
9.Arthas heapdump(dump java heap, 类似 jmap 命令的 heap dump 功能)
10.Arthas logger(查看 logger 信息,更新 logger level)
14.Arthas perfcounter(查看当前 JVM 的 Perf Counter 信息)
15.Arthas vmtool(从 jvm 里查询对象,执行 forceGc)
17.Arthas mc(Memory Compiler/内存编译器 )
18.Arthas redefine(加载外部的.class文件,redefine到JVM里 )
19.Arthas classloader (查看 classloader 的继承树,urls,类加载信息)
23.Arthas stack (输出当前方法被调用的调用路径)
24.Arthas trace (方法内部调用路径,并输出方法路径上的每个节点上耗时)
25.Arthas tt(方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测)
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。