"Go" JVM statistics monitoring Tool-jstat

Source: Internet
Author: User

Original link http://www.javaranger.com/archives/575



Jstat Overview   Help jstat [ generaloption | outputoptions vmid [interval[s|ms] [ Count]] ]  generaloption General Command line Options   (-help, -options, or -version)   Outputoptions a number of output options (output option), which can include a single statoption, plus other-t, -h  or-j options.  vmid Virtual machine ID (virtual machine identifier),  A string representing the target JVM. The general syntax format for VIMID is [protocol:][//]lvmid[@ hostname[:p Ort]/servername] This syntax is similar to URI syntax.  vmid can be a number, or it can be composed of more complex strings such as protocol + hostname + port.  INTERVAL[S|MS] sampling interval, in seconds or MS, the default is milliseconds and must be a positive integer. When this parameter value is set, Jstat outputs the results at each sampling interval.  count the number of samples to display, the default is infinity, that is, until the target JVM process is terminated or the JSTAT process is terminated, the value must be a positive integer.    Description The Jstat command tool is used to display performance statistics for the JVM, and the target virtual machine is marked with Vmid.  virtual machine identifier (VMID) syntax:  [protocol:][//]lvmid[@hostname [:p Ort][/servername] Protocol communication Protocol, if neither protocol  nor hostname are specified, the optimal local protocol of the platform itself is used, and if the protocol  is unspecified but hostname is specified, the default protocol is RMI.  lvmid Local virtual machine identity (the local virtual machine identifier for the target  jvM), is the only vmid parameter value that must be specified. the lvmid  is often the process ID of the operating system target JVM, and you can use the JPS command or the PS command to view the Lvmid.  hostname hostname or IP address, unspecified if not specified, the default port for Localhost. port to communicate with the remote server, if hostname or protocol are not specified, port does not have to be specified. For the default RMI protocol, port refers to the RMI port number registered by the remote host, which defaults to 1099.  servername if protocol is specified as the local best Protocol (the optimized local protocol ), the field can be ignored, for RMI protocol, ServerName represents the name of the RMI remote object in the remote host.   Parameter options The Jstat command supports two parameters, common parameters (general options) and output parameters (Output options). The general parameters are used to display the basic usage and version information of the Jstat, and the output parameters determine the format and content of the output statistics. The   General option (General options) is exclusive, and one of the specified common parameters cannot specify additional parameters, including other common parameters and output parameter options.  -help Help information-version version information-options display output options parameter list   output options (output options) If you do not set a common option, you can set the output options. The output option determines the output and format of the Jstat command, which can contain a single statoption, plus other output commands (-h, -t  and-J) .statoption  must be placed in front. If the jstat -gccapacity -t 1234  output is formatted as a tabular form, the first behavior is listed in each column. You can use the-h parameter to specify how many rows are displayed for the row names, such as jstat -gcnewcapacity -h 2 31538 250 7 for displaying the new generation of garbage collection capacity statistics. Each of the two rows displays a column name, with a sampling interval of 250ms and a total of 7 sampling times.   Use the-t parameter to display the timestamp as the first column of the output, with the column named Timestamp, which indicates that since the target JThe elapsed time, in seconds, since the VM started.   Use interval  and  count  parameters to determine the frequency and time of sampling, as shown in the previous example.   Note that the: jstat  output content format may change in later versions, so it is not recommended to write your own script parsing.  -statoption determines the statistics displayed jstat . The following table lists the available options (colleagues display English conveniently to see what each abbreviation means). You can use  -options to see which options are installed on the system platform. Option displays...class class loader's behavioral statistics. statistics on the behavior of the class loader.compiler hotspt  JIT compiler behavior statistics. Statistics of the behavior of the hotspot just-in-time compiler.gc   The garbage collection heap behavior statistics. Statistics of the behavior of the garbage collected heap.gccapacity   Each garbage collection generation capacity (Young,old,perm) and their corresponding spatial statistics. statistics of the capacities of the generations and their  corresponding spaces.gccause  Garbage Collection Statistics Overview (same as-gcutil), the reason for attaching the last two GC events. summary of garbage collection statistics  (Same as -gcutil), with  the cause of the last andcurrent  (if applicable)  garbage collection events.gcnew  Cenozoic Behavioral Statistics. statistics of the behavior of the new generation.gcnewcapacity  The new generation and its corresponding memory space statistics. statistics of the sizes of the new generations and its  corresponding spaces.gcold  of the old generation and the generation of immortal behavior statistics. statistics of the behavior of the old and permanent  generations.gcoldcapacity  old generation behavior statistics. statistics of the sizes of the old generation.gcpermcapacity  The behavior statistics of immortal generation. statistics of the sizes of the permanent generation.gcutil  garbage Collection Statistics overview. Summary of garbage collection statistics.printcompilation hotspot Compile method statistics. Hotspot compilation method statistics.-h n every n samples   (rows), n is a positive integer, the default is 0, which represents only the first behavior column header. -t n the first line of output is a timestamp, which represents the elapsed time, in seconds, since the target JVM started. -jjavaoption Pass JAVaoption to Java startup parameters. For example,,-j-xms48m  set Java startup minimum memory to 48M. For a complete list of startup parameters, see:java – the java application launcher  (Solaris) java – the  Java application launcher  (Linux) java – the java application  launcher  (Windows)  -class option class loader statistics. Class loader statistics Column name   describes the number of classes that loaded  has loaded. bytes  the number of bytes (in kilobytes) that have been loaded by the class. unloaded  the number of classes unloaded. bytes  the number of bytes (in kilobytes) that the unloaded class occupies. time  the time it takes to load and unload operations. -compiler optionhotspt jit compiler behavior Statistics column name   Description compiled  number of compilation tasks performed failed  compilation failures invalid  The number of failed compilation tasks time  the time it took for the compilation task to execute failedtype  the compiled task type failedmethod  the last compilation failed class name and method-gc option garbage collection Statistic column name   describes s0c  current survivor space 0 capacity. current survivor space 0 capacity  (KB). S1c survivor space 1 capacity. current survivor space 1 capacity  (KB). Use of s0u survivor space 0 . Survivor space 0 utilization  (KB). Use of s1u survivor space 1 . survivor space 1 utilization  (KB). ec  the current generation of Eden space capacity. current eden space capacity  (KB) .eu  The new generation of Eden space utilization. eden space utilization  (KB) .oc  current age generation space capacity. current old space capacity  (KB). ou  use of older generations. old space utilization  (KB). pc  the current life-generation space capacity. current permanent space capacity  (KB). pu  the space utilization of immortal generation. permanent space utilization  (KB). ygc  the number of new generation GC events.  Number of young generation GC Events.YGCT  New generation GC time consuming. Young generation garbage collection time. Number of FGC FULL GC. Number of full gc events. FGCT FULL GC time-consuming. Full garbage collection time. gct  Total GC time consuming. TOTAL GARBAGE COLLECTION TIME.-GCCAPACITY OPTIONGC Memory space Usage Statistic column name   Description ngcmn  minimum Cenozoic capacity. Minimum new generation capacity  (KB). ngcmx  maximum Cenozoic capacity. maximum new generation capacity  (KB). ngc  current Cenozoic capacity. current new generation capacity  (KB). s0c  Current Cenozoic survivor 0 region capacity. current survivor space 0 capacity  (KB). s1c  Current Cenozoic survivor 1 region capacity. current survivor space 1 capacity  (KB). ec  the current generation of Eden space capacity. current eden space capacity  (KB). ogcmn  minimum old generation capacity. minimum old generation capacity  (KB). ogcmx  maximum old generation capacity. maximum old generation capacity  (KB). ogc  current old generation capacity. current old generation capacity  (KB) .oc  current age generation space capacity. current old space capacity  (KB). pgcmn  minimum Immortal generation capacity. minimum permanent generation capacity  (KB). pgcmx  the largest immortal generation capacity. maximum permanent generation capacity  (KB). pgc  the current immortal generation capacity. current permanent generation capacity  (KB). pc  Minimum living space capacity. Current&nbsP permanent space capacity  (KB). ygc  generation of GC times. Number of NUMBER OF YOUNG GENERATION GC EVENTS.FGC FULL GC. Number of full gc events.-gccause option Garbage Collection Statistics Overview (same as-gcutil), the reason for attaching the last two GC events. Relative to the statistics given by  -gcutil,  gccause adds the following columns:  garbage collection statistics, including  gc events Column name   Description lgcc  last GC reason. cause of last garbage collection.gcc  this GC reason. Cause of current garbage collection.-gcnew option New Generation Statistics Column name   Description s0c  current survivor  0 area capacity. currentsurvivor space 0 capacity  (KB). s1c  current survivor 1 area capacity. currentsurvivor space 1 capacity  (KB). s0u  Current utilization of survivor 0 area. survivor space 0 utilization  (KB). s1u  Current utilization of survivor 1 area. survivor space 1 utilization  (KB) .tt  threshold,  is used to control the number of times the object survives in the Cenozoic. Tenuring threshold. mtt  threshold,  to control the maximum number of times an object survives in the Cenozoic。 Maximum tenuring threshold. dss  expected survival size. desired survivor size  (KB). ec  the current Eden space capacity. current eden space capacity  (KB). Eu eden utilization of space. eden space utilization  (KB). ygc  the number of GC times for young generations. Number of young generation gc events. ygct  Young generation GC time consuming. young generation garbage collection time.note:  If an age of survivor  If the size of the space object exceeds Desired survivor size, the tenuring threshold is recalculated, whichever is the minimum of age and Maxtenuringthreshold  -gcnewcapacity option Cenozoic Spatial Statistics column name   Description ngcmn  minimum Cenozoic capacity. minimum new generation capacity  (KB). ngcmx  maximum Cenozoic capacity. maximum new generation capacity  (KB). ngc  current Cenozoic capacity. current new generation capacity  (KB). s0cmx  maximum survivor 0 area capacity. maximum survivor space 0 capacity  (KB). s0c  current survivor 0 area capacity. current survivor space 0 capacity  (KB). S1cmx&nbSP; maximum survivor 1 area capacity. maximumsurvivor space 1 capacity  (KB). s1c  current survivor 1 area capacity. current survivor space 1 capacity  (KB). ecmx  maximum Eden area capacity. maximum eden space capacity  (KB). ec  current Eden area capacity. current eden space capacity  (KB). Number of YGC YOUNG GC. Number of young generation gc events. Number of FGC FULL GC. Number of full gc events.-gcold option old generation and permanent generation statistics column name   Description pc  The current permanent generation space capacity. current permanent space capacity  (KB). pu  of permanent generation space utilization. permanent space utilization  (KB) .oc  current age generation space capacity. current old space capacity  (KB). ou  the utilization of the old generation space. old space utilization  (KB). Number of YGC YOUNG GC. Number of young generation gc events. Number of FGC FULL GC. Number of full gc events. FGCT FULL GC time-consuming. full garbage collection&Nbsp;time. GCT GC total time-consuming. Total garbage collection time.-gcoldcapacity option Old generation Statistics Column name   Description ogcmn  Minimum age generation capacity. minimumold generation capacity  (KB). ogcmx  maximum old generation capacity. maximumold generation capacity  (KB). ogc  current old generation capacity. currentold generation capacity  (KB) .oc  current age generation space capacity. currentold space capacity  (KB). Number of YGC YOUNG GC. Number of young generation gc events. Number of FGC FULL GC. Number of full gc events. FGCT FULL GC time-consuming. Full garbage collection time. gct  Total GC time consuming. Total garbage collection time.-gcpermcapacity option Immortal Generation Statistics Column name   Description pgcmn minimum  permanent generation capacity  (KB). pgcmx maximum permanent generation capacity  (KB). pgc current permanent generation capacity  (KB). pc current permanent space capacity  (KB). ygc&nbsp Number of young generation gc events. Fgc number of full gc events. Fgct full garbage collection time. gct total garbage collection time.-gcutil optionsummary of garbage  Collection statistics Column name   Description s0 survivor 0 area utilization. Survivor space 0 utilization as a percentage ofthe space ' s  Current capacity. S1 survivor 1 area utilization. Survivor space 1 utilization as a percentage ofthe space ' s  Current capacity. E eden area utilization. Eden space utilization as a percentage ofthe space ' s current  capacity. o  the utilization rate of old generation space. Old space utilization as a percentage ofthe space ' s current  capacity. p  the space utilization of immortal generation. Permanent space utilization as a percentage ofthe space ' s  current capacity. Number of YGC YOUNG GC. Number of young generation gc events. YGCT YOUNG GC time-consuming. Young generation garbage collection time. Number of FGC FULL GC. Number of full gc events. FGCT FULL GC time-consuming. Full garbage collection time. GCT GC total time-consuming. Total garbage collection time.-printcompilation optionhotspot compiler method  statistics Column name   describes the number of compilation tasks performed by compiled  Size number of bytes of bytecode  for the method. type  the compilation type. Compilation type. The method  class name and method name. The class name uses "/" instead of the original namespace symbol "."   Example   The following example represents some statistics for the local JVM (lvmid  21891).  gcutil  Use example   use-gcutil to show GC statistics, sampled once per 250ms, and sampled 7 times.  jstat -gcutil 21891 250 7s0 s1 e o p ygc ygct fgc  fgct gct12.44 0.00 27.20 9.49 96.70 78 0.176 5 0.495 0.67212.44 0.00 62.16 9.49 96.70 78 0.176 5 0.495  0.67212.44 0.00 83.97 9.49 96.70 78 0.176 5 0.495 0.6720.00  7.74 0.00 9.51 96.70 79 0.177 5 0.495 0.6730.00 7.74 23.37  9.51 96.70 79 0.177 5 0.495 0.6730.00 7.74 43.82 9.51  96.70 79 0.177 5 0.495 0.6730.00 7.74 58.11 9.51 96.71 79  0.177 5 0.495 0.673 This example shows a new generation GC that takes 0.001 seconds between the third and fourth samples. This GC moves some objects from the Eden Zone (E) to the old age space (O), resulting in an aging space utilization rate from 9.49% to 9.51%. Before this GC, the Survivor Zone utilization rate was 12.44%,GC and then changed to 7.44%.   Repeating column names   This example shows the use of the-H3 option to make the output of-gcnew display the column name once per 3 rows.  jstat -gcnew -h3 21891 250s0c s1c s0u s1u tt mtt dss  ec eu ygc ygct64.0 64.0 0.0 31.7 31 31 32.0 512.0  178.6 249 0.20364.0 64.0 0.0 31.7 31 31 32.0 512.0 355.5 249 0.20364.0  64.0 35.4 0.0 2 31 32.0 512.0 21.9 250 0.204s0c s1c  S0U S1U TT MTT DSS EC EU YGC YGCT64.0 64.0 35.4  0.0 2 31 32.0 512.0 245.9 250 0.20464.0 64.0 35.4 0.0 2  31 32.0 512.0 421.1 250 0.20464.0 64.0 0.0 19.0 31 31  32.0 512.0 84.4 251 0.204s0c s1c s0u s1u tt mtt dss  ec eu ygc ygct64.0 64.0 0.0 19.0 31 31 32.0 512.0  306.7 251 0.204 This example shows two GC operations, and the first YOUNG GC occurs between the second sample and the third sample, lasting 0.001 seconds. This GC found that the  survivor 0 area used more than the DSS, so the object moved to the Laosheng generation, TT from 31 to 2.  another GC occurred between the 5th and 6th samples, this time the GC resets the TT back to 31.  Examples with timestamps   This example samples are sampled 3 times per 250ms sample. The-t  option is used to display the timestamp in the first column. jstat -gcoldcapacity -t 21891 250 3timestamp ogcmn ogcmx ogc  oc ygc fgc fgct gct150.1 1408.0 60544.0 11696.0 11696.0 194  80 2.874 3.799150.4 1408.0 60544.0 13820.0 13820.0 194 81  2.938 3.863150.7 1408.0 60544.0 13820.0 13820.0 194 81 2.938  The 3.863Timestamp column shows the elapsed time, in seconds, since the target JVM was started. In addition, the,-gcoldcapacity  option output shows that the old generation capacity   (OGC) and old generation space occupancy has been growing. After the 81st time FULL GC, the OGC rose from 11696KB to 13820KB. The old generation has a maximum capacity of 60544KB, so the space is enough.   Remote jvm  This example shows that the JVM with a system name of remote.domain lvmid  40496 is monitored with the-gcutil  option and output once per second.  jstat -gcutil [email protected]1000 ... The output is slightly lvmid plus the remote host name is composed of Vmid[email protected]。 The VMID uses the RMI protocol to connect the remote host's default JSTATD service. The JSTATD service uses Rmiregistry to register port 1099

"Go" JVM statistics monitoring Tool-jstat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.