jstat用法

jstat(JVM Statistics Monitoring Tool)是用于监视虚拟机各种运行状态信息的命令行工具。它可以显示本地或者远程虚拟机进程中的类装载、内存、垃圾收集、JIT编译等运行数据,在没有GUI图形界面,只提供了纯文本控制台环境的服务器上,它将是运行期定位虚拟机性能问题的首选工具。
jstat命令格式为:

jstat [ option vmid [interval[s|ms] [count]] ]

对于命令格式中的VMID与LVMID需要特别说明一下:如果是本地虚拟机进程,VMID与LVMID是一致的,如果是远程虚拟机进程,那VMID的格式应当是:

[protocol:][//]lvmid[@hostname[:port]/servername]

参数interval和count代表查询间隔和次数,如果省略这两个参数,说明只查询一次。假设需要每250毫秒查询一次进程2764垃圾收集状况,一共查询20次,那命令应当是:

jstat -gc 2764 250 20

选项option代表着用户希望查询的虚拟机信息,主要分为3类:类装载、垃圾收集、运行期编译状况,其参数如下:

OptionDisplays...
classStatistics on the behavior of the class loader
compilerStatistics on the behavior of the HotSpot Just-In-Time compiler
gcStatistics on the behavior of the garbage collected heap
gccapacityStatistics of the capacities of the generations and their corresponding spaces.
gccauseSummary of garbage collection statistics (same as -gcutil), with the cause of the last and current (if applicable) garbage collection events.
gcnewStatistics of the behavior of the new generation.
gcnewcapacityStatistics of the sizes of the new generations and its corresponding spaces.
gcoldStatistics of the behavior of the old and permanent generations.
gcoldcapacityStatistics of the sizes of the old generation.
gcpermcapacityStatistics of the sizes of the permanent generation.
gcutilSummary of garbage collection statistics.
printcompilationSummary of garbage collection statistics.

jstat执行样例:

IvydeMacBook-Air% jstat -gc 536
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT   
2560.0 2560.0  0.0    0.0   16896.0   5070.7   43520.0      0.0     21504.0 2901.1      0    0.000   0      0.000    0.000
显示说明
S0CCurrent survivor space 0 capacity(KB).
S1CCurrent survivor space 1 capacity(KB).
S0USurvivor space 0 utilization(KB).
S1USurvivor space 1 utilization(KB).
ECCurrent eden space capacity(KB).
EUEden space utilization(KB).
OCCurrent oldpace capacity(KB).
OUOld space utilization(KB).
PCCurrent permanet space capacity(KB).
PUPermanent space utilization(KB).
YGCNumber of young generation GC Events.
YGCTYoung generation garbage collection time.
FGCNumber of full GC events
FGCTFull garbage collection time.
GCTTotal garbage collection time.

转载于:https://www.cnblogs.com/wardensky/p/4322473.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值