linux java测试工具_Linux下Java虚拟机状态监测工具

Linux下Java虚拟机状态检测工具

工具名称:

jps     JVM Process Status Tool - Lists instrumented HotSpot Java virtual machines on a target system.

jstat   JVM Statistics Monitoring Tool - Attaches to an instrumented HotSpot Java virtual machine and collects and logs performance statistics as specified by the command line options.

jstatd  JVM jstat Daemon - Launches an RMI server application that monitors for the creation and termination of instrumented HotSpot Java virtual machines and provides a interface to allow remote monitoring tools to attach to Java virtual machines running on the local system.

命令格式:

jps [ options ] [ hostid ]

options

command line options

hostid

The host identifier of the host for which the process report should be generated. The hostid may include optional components that indicate the communications protocol, port number, and other implementation specific data.

jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]

generalOption

A single general command-line option (-help, -options, or -version)

outputOptions

One or more output options, consisting of a single statOption, plus any of the -t, -h, and -J options.

vmid

Virtual machine identifier, a string indicating the target Java virtual machine (JVM). The general syntax is

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

interval[m|sm]

Sampling interval in the specified units, seconds (s) or milliseconds (ms). Default units are milliseconds.  Must be a positive integer.  If specified, jstatwill produce its output at each interval.

count

Number of samples to display. Default value is infinity; that is, jstat displays statistics until the target JVM terminates or the jstat command is terminated.  Must be a positive integer.

outputOptions include:

Statistics on the behavior of the class loader.

Statistics of the behavior of the HotSpot Just-in-Time compiler.

Statistics of the behavior of the garbage collected heap.

Statistics of the capacities of the generations and their corresponding spaces.

Summary of garbage collection statistics (same as -gcutil), with the cause of the last and current (if applicable) garbage collection events.

Statistics of the behavior of the new generation.

Statistics of the sizes of the new generations and its corresponding spaces.

Statistics of the behavior of the old and permanent generations.

Statistics of the sizes of the old generation.

Statistics of the sizes of the permanent generation.

Summary of garbage collection statistics.

HotSpot compilation method statistics.

使用方法:

先用jps命令列出所有的虚拟机id,然后用jstat命令给出outputOptions参数输出相应统计数据的结果。

范例:

#jps

17562  Jps

15623  Resin

#jstat -gcutil -h6 15623 4s

S0   S1     E      O      P     YGC   YGCT    FGC  FGCT     GCT

0.00 0.00  40.83   3.26  97.68   6    0.169   2    0.256    0.424

0.00 0.00  40.94   3.26  97.68   6    0.169   2    0.256    0.424

0.00 0.00  41.05   3.26  97.68   6    0.169   2    0.256    0.424

0.00 0.00  41.05   3.26  97.68   6    0.169   2    0.256    0.424

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值