使用jstat(监控整体的class情况、gc情况)监控JVM
jstat是用于监视虚拟机运行时状态信息的命令,它可以显示出虚拟机进程中的类装载、内存、垃圾收集、JIT编译等运行数据。命令格式jstat [options] VMID [interval] [count]参数[options] : 操作参数,一般使用 -gcutil 查看gc情况VMID : 本地虚拟机进程ID,即当前运行的java进程号(PID)[interval] : ...
·
jstat是用于监视虚拟机运行时状态信息的命令,它可以显示出虚拟机进程中的类装载、内存、垃圾收集、JIT编译等运行数据。
命令格式
jstat [options] VMID [interval] [count]
参数
[options] : 操作参数,一般使用 -gcutil 查看gc情况
VMID : 本地虚拟机进程ID,即当前运行的java进程号(PID)
[interval] : 连续输出的时间间隔,单位为秒或者毫秒
[count] : 连续输出的次数,如果缺省打印无数次
option 参数总览
| Option | Displays |
|---|---|
| class | 类加载的行为统计。Statistics on the behavior of the class loader. |
| compiler | HotSpt JIT编译器行为统计。Statistics of the behavior of the HotSpot Just-in-Time compiler. |
| gc | 垃圾回收堆的行为统计。Statistics of the behavior of the garbage collected heap. |
| gccapacity | 各个垃圾回收代容量(young,old,perm)和他们相应的空间统计。Statistics of the capacities of the generations and their corresponding spaces. |
| gcutil | 垃圾回收统计概述(百分比)。Summary of garbage collection statistics. |
| gccause | 垃圾收集统计概述(同-gcutil),附加最近两次垃圾回收事件的原因。Summary of garbage collection statistics (same as -gcutil), with the cause of the last and |
| gcnew | 新生代行为统计。Statistics of the behavior of the new generation. |
| gcnewcapacity | 新生代与其相应的内存空间的统计。Statistics of the sizes of the new generations and its corresponding spaces. |
| gcold | 年老代和永生代行为统计。Statistics of the behavior of the old and permanent generations. |
| gcoldcapacity | 年老代行为统计。Statistics of the sizes of the old generation. |
| gcpermcapacity | 永生代行为统计。Statistics of the sizes of the permanent generation. |
| printcompilation | HotSpot编译方法统计。HotSpot compilation method statistics. |
我们以官方文档1.8为例,命令操作很详细:这是链接.
关于垃圾回收的稍微总结一下:
垃圾收集 -gc、-gcutil、-gccause、-gcnew、-gcold
S0C、S1C、S0U、S1U:S0和S1的总量与使用量(S0 和S1 只会启用一个,未启用的会是0)
EC、EU eden区总量与使用量
OC、OU:Old区总量与使用量
MC、MU:Metaspace区总量与使用量
CCSC、CCSU:压缩类空间总量与使用量
YGC、YGCT:YoungGC的次数与时间
FGC、FGCT:FullGC的次数与时间
GCT:总的GC时间
百度一下也有很多翻译过来的,酌情使用:
https://www.cnblogs.com/myna/p/7567769.html
「智能机器人开发者大赛」官方平台,致力于为开发者和参赛选手提供赛事技术指导、行业标准解读及团队实战案例解析;聚焦智能机器人开发全栈技术闭环,助力开发者攻克技术瓶颈,促进软硬件集成、场景应用及商业化落地的深度研讨。 加入智能机器人开发者社区iRobot Developer,与全球极客并肩突破技术边界,定义机器人开发的未来范式!
更多推荐



所有评论(0)