Chinaunix首页 | 论坛 | 博客
  • 博客访问: 126954
  • 博文数量: 100
  • 博客积分: 1850
  • 博客等级: 上尉
  • 技术积分: 650
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-02 23:52
文章分类

全部博文(100)

文章存档

2016年(1)

2009年(1)

2008年(5)

2007年(11)

2006年(32)

2005年(50)

我的朋友

分类: LINUX

2006-04-16 17:58:33

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 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, jstat will 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.
gcutil 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
阅读(1285) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~