Arthas vmtool(从 jvm 里查询对象,执行 forceGc)

简介: Arthas vmtool(从 jvm 里查询对象,执行 forceGc)

image.png

@[toc]

二、命令列表

2.1 jvm相关命令

2.1.15 vmtool(从 jvm 里查询对象,执行 forceGc)

vmtool 利用JVMTI接口,实现查询内存对象,强制 GC 等功能。

问题:arthas命令中,vmtool和sc有啥区别,感觉都是从jvm查看已加载的类信息?

答案:

  • vmtool 命令提供了更广泛的 JVM 监控功能,包括但不限于类加载器和线程状态等。
  • sc 命令则更专注于类的加载情况,适用于获取详细的类信息。

举例1:获取对象

基本用法

vmtool --action getInstances --className 全路径类名 --limit 10

提示

通过 --limit参数,可以限制返回值数量,避免获取超大数据时对 JVM 造成压力。默认值是 10。

[arthas@5462]$ vmtool --action getInstances --className java.lang.String --limit 10
@String[][
    @String[OK],
    @String[OK],
    @String[com.hero.lte.ems.register.ServiceConfig],
    @String[PLATFORM],
    @String[20.150.12.100],
    @String[PLATFORM],
    @String[java.lang.Long],
    @String[OK],
    @String[{"equipmentId":73,"id":100073,"ip":"172.31.1.73","port":8888,"processCode":"ems_enodeb","service":"enodeb"}],
    @String[ID:localhost.localdomain-41003-1726383320757-3:1:24:1:2330],
]
[arthas@5462]$

本人其他相关文章链接

1.Arthas 全攻略:让调试变得简单
2.Arthas dashboard(当前系统的实时数据面板)
3.Arthas thread(查看当前JVM的线程堆栈信息)
4.Arthas jvm(查看当前JVM的信息)
5.Arthas sysprop(查看和修改JVM的系统属性)
6.Arthas sysenv(查看JVM的环境变量)
7.Arthas vmoption(查看和修改 JVM里诊断相关的option)
8.Arthas getstatic(查看类的静态属性 )
9.Arthas heapdump(dump java heap, 类似 jmap 命令的 heap dump 功能)
10.Arthas logger(查看 logger 信息,更新 logger level)
11.Arthas mbean(查看 Mbean 的信息)
12.Arthas memory(查看 JVM 内存信息)
13.Arthas ognl(执行ognl表达式)
14.Arthas perfcounter(查看当前 JVM 的 Perf Counter 信息)
15.Arthas vmtool(从 jvm 里查询对象,执行 forceGc)
16.Arthas jad(字节码文件反编译成源代码 )
17.Arthas mc(Memory Compiler/内存编译器 )
18.Arthas redefine(加载外部的.class文件,redefine到JVM里 )
19.Arthas classloader (查看 classloader 的继承树,urls,类加载信息)
20.Arthas sc(查看JVM已加载的类信息 )
21.Arthas sm(查看已加载类的方法信息 )
22.Arthas monitor(方法执行监控)
23.Arthas stack (输出当前方法被调用的调用路径)
24.Arthas trace (方法内部调用路径,并输出方法路径上的每个节点上耗时)
25.Arthas tt(方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测)
26.Arthas watch (方法执行数据观测)
27.Arthas profiler(使用async-profiler对应用采样,生成火焰图)

image.png

重要信息

image.png
image.png
image.png

目录
相关文章
|
1月前
|
Arthas 监控 Java
Arthas memory(查看 JVM 内存信息)
Arthas memory(查看 JVM 内存信息)
76 6
|
6天前
|
Arthas 监控 Java
Arthas jvm(查看当前JVM的信息)
Arthas jvm(查看当前JVM的信息)
46 17
|
6天前
|
Arthas 监控 Java
Arthas vmoption(查看和修改 JVM里诊断相关的option)
Arthas vmoption(查看和修改 JVM里诊断相关的option)
43 16
|
4天前
|
Arthas 监控 Java
Arthas sysprop(查看和修改JVM的系统属性)
Arthas sysprop(查看和修改JVM的系统属性)
32 9
|
5天前
|
Arthas 监控 Java
Arthas thread(查看当前JVM的线程堆栈信息)
Arthas thread(查看当前JVM的线程堆栈信息)
64 10
|
14天前
|
Arthas 监控 Java
Arthas perfcounter(查看当前 JVM 的 Perf Counter 信息)
Arthas perfcounter(查看当前 JVM 的 Perf Counter 信息)
39 15
|
1月前
|
Arthas 监控 Java
Arthas redefine(加载外部的.class文件,redefine到JVM里 )
Arthas redefine(加载外部的.class文件,redefine到JVM里 )
95 15
|
1月前
|
Arthas 监控 Java
Arthas sc(查看JVM已加载的类信息 )
Arthas sc(查看JVM已加载的类信息 )
50 9
|
6月前
|
存储 算法 Java
散列表的数据结构以及对象在JVM堆中的存储过程
本文介绍了散列表的基本概念及其在JVM中的应用,详细讲解了散列表的结构、对象存储过程、Hashtable的扩容机制及与HashMap的区别。通过实例和图解,帮助读者理解散列表的工作原理和优化策略。
108 1
散列表的数据结构以及对象在JVM堆中的存储过程
|
2月前
|
消息中间件 Java 应用服务中间件
JVM实战—2.JVM内存设置与对象分配流转
本文详细介绍了JVM内存管理的相关知识,包括:JVM内存划分原理、对象分配与流转、线上系统JVM内存设置、JVM参数优化、问题汇总。
JVM实战—2.JVM内存设置与对象分配流转
下一篇
阿里云OSS
OSZAR »