Jstat is a lightweight gadget that comes with the JDK. The full name "Java Virtual machine Statistics monitoring Tool", which is located in the Java Bin directory, mainly uses the JVM built-in instructions for Java application resources and performance of real-time command line monitoring, including the heap Monitoring of size and garbage collection status. Visible, Jstat is a lightweight, JVM-specific tool that works well.
The Jstat tool is particularly powerful and has a number of options to view in detail the usage of each part of the heap, as well as the number of loaded classes. When used, add the process ID of the viewing process and the selected parameters. The reference format is as follows:
Jstat-options
You can list the options supported by the current JVM version, which are common
- L Class (class loader)
- l Compiler (JIT)
- L GC (GC heap status)
- L gccapacity (each district size)
- L Gccause (last GC statistics and causes)
- L gcnew (New zone statistics)
- L gcnewcapacity (new zone size)
- L Gcold (Old Quarter statistics)
- L gcoldcapacity (old quarter size)
- L gcpermcapacity (Permanent zone size)
- L Gcutil (GC statistics Rollup)
- L Printcompilation (Hotspot compilation statistics)
1, jstat–class<pid>: Display the number of loading class, and the space occupied information.
Show Column names |
Specific description |
Loaded |
The number of classes loaded |
Bytes |
The number of bytes occupied by the load class |
Unloaded |
Unload the number of classes |
Bytes |
Number of bytes to unload class |
Time |
Time taken to load and unload classes |
2, Jstat-compiler <pid> shows the number of VMS in real-time compilation and other information.
Show Column names |
Specific description |
Compiled |
Number of compile task executions |
Failed |
Number of failed compile task executions |
Invalid |
Compile task execution Failure quantity |
Time |
Compile task consumption time |
Failedtype |
The type of the last compilation failure task |
Failedmethod |
The class and method where the last compilation failure task is located |
3, JSTAT-GC <pid>: The GC information can be displayed, the number of times the GC is viewed, and the time.
Show Column names |
Specific description |
s0c |
Capacity of the first Survivor (Survivor area) in the Young Generation (bytes) |
S1c |
Capacity of the second survivor (Survivor area) in the younger generation (bytes) |
s0u |
The first survivor (Survivor area) of the young generation has currently used space (bytes) |
s1u |
The second survivor (Survivor area) of the young generation has currently used space (bytes) |
EC |
The capacity of Eden (Eden) in the Young Generation (bytes) |
EU |
The young generation of Eden (Eden) has currently used space (bytes) |
Oc |
Capacity in old generation (bytes) |
OU |
Old generation currently used space (bytes) |
Pc |
Perm (persistent generation) capacity (bytes) |
Pu |
Perm (persistent generation) currently used space (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
Ygct |
Time taken by the young generation GC from application startup to sampling (s) |
FGC |
Old (full GC) GC times from application startup to sampling |
Fgct |
Time (s) used by the old (full GC) GC from application startup to sampling |
GCT |
Total time (s) used by GC from application startup to sampling |
4,jstat-gccapacity <pid>: can display the use and occupancy of three-generation (Young,old,perm) objects in VM memory
Show Column names |
Specific description |
Ngcmn |
Initial (minimum) size in Young generation (bytes) |
Ngcmx |
Max capacity of young generation (bytes) |
Ngc |
Current capacity in young generation (bytes) |
s0c |
Capacity of the first Survivor (Survivor area) in the Young Generation (bytes) |
S1c |
Capacity of the second survivor (Survivor area) in the younger generation (bytes) |
EC |
The capacity of Eden (Eden) in the Young Generation (bytes) |
Ogcmn |
Initial (minimum) size in old generation (bytes) |
Ogcmx |
Maximum capacity in old generation (bytes) |
OGC |
The current newly generated capacity of the old generation (bytes) |
Oc |
Capacity in old generation (bytes) |
Pgcmn |
The size (in bytes) of the initialization (minimum) in perm generation |
Pgcmx |
Maximum capacity of the perm generation (bytes) |
Pgc |
The current newly generated capacity of the perm generation (bytes) |
Pc |
Perm (persistent generation) capacity (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
FGC |
Old (full GC) GC times from application startup to sampling |
5, Jstat-gcutil <pid>: Statistics GC Information
Show Column names |
Specific description |
S0 |
The first survivor (Survivor area) in the younger generation has been used as a percentage of current capacity |
S1 |
The second survivor (Survivor area) of the young generation has been used as a percentage of current capacity |
E |
Eden (Eden) in the young generation has been used as a percentage of current capacity |
O |
Percentage of current capacity used by old generation |
P |
Percentage of current capacity used by perm generation |
Ygc |
Number of GC times in young generations from application startup to sampling |
Ygct |
Time taken by the young generation GC from application startup to sampling (s) |
FGC |
Old (full GC) GC times from application startup to sampling |
Fgct |
Time (s) used by the old (full GC) GC from application startup to sampling |
GCT |
Total time (s) used by GC from application startup to sampling |
6, Jstat-gcnew <pid>: Information of the young generation object.
Show Column names |
Specific description |
s0c |
Capacity of the first Survivor (Survivor area) in the Young Generation (bytes) |
S1c |
Capacity of the second survivor (Survivor area) in the younger generation (bytes) |
s0u |
The first survivor (Survivor area) of the young generation has currently used space (bytes) |
s1u |
The second survivor (Survivor area) of the young generation has currently used space (bytes) |
Tt |
Number of holding limits |
Mtt |
Maximum number of hold limits |
EC |
The capacity of Eden (Eden) in the Young Generation (bytes) |
EU |
The young generation of Eden (Eden) has currently used space (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
Ygct |
Time taken by the young generation GC from application startup to sampling (s) |
7, Jstat-gcnewcapacity<pid>: Information of young generation objects and their occupancy.
Show Column names |
Specific description |
Ngcmn |
Initial (minimum) size in Young generation (bytes) |
Ngcmx |
Max capacity of young generation (bytes) |
Ngc |
Current capacity in young generation (bytes) |
S0cmx |
Maximum capacity of the first Survivor (Survivor area) in the Young Generation (bytes) |
s0c |
Capacity of the first Survivor (Survivor area) in the Young Generation (bytes) |
S1cmx |
Maximum capacity of the second survivor (Survivor area) in the younger generation (bytes) |
S1c |
Capacity of the second survivor (Survivor area) in the younger generation (bytes) |
Ecmx |
Maximum capacity of Eden (Eden) in the Young Generation (bytes) |
EC |
The capacity of Eden (Eden) in the Young Generation (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
FGC |
Old (full GC) GC times from application startup to sampling |
8, Jstat-gcold <pid>:old The information of the object.
Show Column names |
Specific description |
Pc |
Perm (persistent generation) capacity (bytes) |
Pu |
Perm (persistent generation) currently used space (bytes) |
Oc |
Capacity in old generation (bytes) |
OU |
Old generation currently used space (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
FGC |
Old (full GC) GC times from application startup to sampling |
Fgct |
Time (s) used by the old (full GC) GC from application startup to sampling |
GCT |
Total time (s) used by GC from application startup to sampling |
9, stat-gcoldcapacity <pid>: The information of the old generation object and its consumption.
Show Column names |
Specific description |
Ogcmn |
Initial (minimum) size in old generation (bytes) |
Ogcmx |
Maximum capacity in old generation (bytes) |
OGC |
The current newly generated capacity of the old generation (bytes) |
Oc |
Capacity in old generation (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
FGC |
Old (full GC) GC times from application startup to sampling |
Fgct |
Time (s) used by the old (full GC) GC from application startup to sampling |
GCT |
Total time (s) used by GC from application startup to sampling |
10, Jstat-gcpermcapacity<pid>: Information of Perm objects and their occupancy.
Show Column names |
Specific description |
Pgcmn |
The size (in bytes) of the initialization (minimum) in perm generation |
Pgcmx |
Maximum capacity of the perm generation (bytes) |
Pgc |
The current newly generated capacity of the perm generation (bytes) |
Pc |
Perm (persistent generation) capacity (bytes) |
Ygc |
Number of GC times in young generations from application startup to sampling |
FGC |
Old (full GC) GC times from application startup to sampling |
Fgct |
Time (s) used by the old (full GC) GC from application startup to sampling |
GCT |
Total time (s) used by GC from application startup to sampling |
11, Jstat-printcompilation <pid>: Current VM execution information.
Show Column names |
Specific description |
Compiled |
Number of compilation tasks |
Size |
Size of bytecode generated by method |
Type |
Compilation type |
Method |
The class name and method name are used to identify the compiled method. The class name is used/as a namespace delimiter. The method name is a method in a given class. The above format is set by the-xx:+printcomplation option |
Turn: Jstat command