Java command simple view JVM memory usage
1. JPS Virtual machine process Status Tool
Syntax jsp [option] [HostID]
Options
Role
-Q
Show Only Lvmid
-M
Pass in Main method parameter when output virtual machine is enabled
-L
Output main class full Name
-V
Output JVM Parameters
Attention:
If the JPS command cannot output vmid data (jdk1.6.0.23/24 bug) in a Linux environment, the catalina.sh file needs to be modified
If [-Z "$CATALINA _tmpdir"]; then?# Define the Java.io.tmpdir to use for catalina?# catalina_tmpdir= "$CATALINA _base"/temp? Catalina_tmpdir=/tmp?fi
Modifying the Catalina_tmpdir Path
2, Jstat virtual machine statistical information monitoring tool
Grammar:
jstat [Option Vmid [Interval[s|ms]] [count]]
Option options
Class
Statistics class loader behavior information
Compiler
Statistical compilation Behavior Information
Gc
Statistics JDK GC time heap information
Gccapacity
Heap capacity information for the different generations of the statistics stack memory
Gccause
Statistics GC (same-gcutil) and events that cause GC
Gcnew
Statistics of the new generation of GC (more detailed than Gcutil)
Gcnewcapacity
New generation heap capacity in GC statistics
Gcold
When statistics GC, the situation of the old age area
Gcoldcapacity
When statistics GC, the old area heap capacity
Gcpermcapacity
When statistics GC, permanent area heap capacity
Gcutil
When statistics GC, the heap condition
Printcompilation
Statistical compilation Behavior Information
For example:
JSTAT-GC 1111 250 2
View virtual machines with a vmid of 1111 executed every 250 milliseconds, twice in total
Results analysis
-class Option:class Loader Statistics
Columndescription
Loaded
Number of classes loaded.
Bytes
Number of Kbytes loaded.
Unloaded
Number of classes unloaded.
Bytes
Number of Kbytes unloaded.
Time
Time spent performing class load and unload operations.
-compiler:hotspot Just-in-time Compiler Statistics
Columndescription
Compiled
Number of compilation tasks performed.
Failed
Number of compilation tasks that failed.
Invalid
Number of compilation tasks that were invalidated.
Time
Time spent performing compilation tasks.
Failedtype
Compile type of the last failed compilation.
Failedmethod
Class name and method for the last failed compilation.
-GC option:garbage-collected Heap Statistics
Columndescription
s0c
Current survivor Space 0 capacity (KB).
S1c
Current survivor Space 1 capacity (KB).
s0u
Survivor Space 0 Utilization (KB).
s1u
Survivor Space 1 Utilization (KB).
EC
Current Eden Space Capacity (KB).
EU
Eden Space Utilization (KB).
Oc
Current old space Capacity (KB).
OU
Old space Utilization (KB).
Pc
Current permanent space Capacity (KB).
Pu
Permanent Space Utilization (KB).
Ygc
Number of young generation GC Events.
Ygct
Young generation garbage collection time.
FGC
Number of full GC events.
Fgct
Full garbage collection time.
GCT
Total garbage collection time.
-gccapacity option:memory Pool Generation and Space Capacities
Columndescription
Ngcmn
Minimum New Generation Capacity (KB).
Ngcmx
Maximum New Generation Capacity (KB).
Ngc
Current New generation capacity (KB).
s0c
Current survivor Space 0 capacity (KB).
S1c
Current survivor Space 1 capacity (KB).
EC
Current Eden Space Capacity (KB).
Ogcmn
Minimum old generation Capacity (KB).
Ogcmx
Maximum old generation Capacity (KB).
OGC
Current old generation capacity (KB).
Oc
Current old space Capacity (KB).
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
Number of young generation GC Events.
FGC
Number of full GC Events.
-gccause option:garbage Collection Statistics, including GC Events
Columndescription
lgcc
Cause of last garbage Collection.
Gcc
Cause of current garbage Collection.
The preceding fields are the same as gcutil.
-gcnew option:new Generation Statistics
Columndescription
s0c
Current survivor Space 0 capacity (KB).
S1c
Current survivor Space 1 capacity (KB).
s0u
Survivor Space 0 Utilization (KB).
s1u
Survivor Space 1 Utilization (KB).
Tt
Tenuring threshold.
Mtt
Maximum tenuring threshold.
Dss
Desired survivor Size (KB).
EC
Current Eden Space Capacity (KB).
EU
Eden Space Utilization (KB).
Ygc
Number of young generation GC events.
Ygct
Young generation garbage collection time.
-gcnewcapacity option:new Generation Space Size Statistics
Columndescription
Ngcmn
Minimum New Generation Capacity (KB).
Ngcmx
Maximum New Generation Capacity (KB).
Ngc
Current New generation capacity (KB).
S0cmx
Maximum survivor Space 0 Capacity (KB).
s0c
Current survivor Space 0 capacity (KB).
S1cmx
Maximum survivor Space 1 Capacity (KB).
S1c
Current survivor Space 1 capacity (KB).
Ecmx
Maximum Eden Space Capacity (KB).
EC
Current Eden Space Capacity (KB).
Ygc
Number of young generation GC events.
FGC
Number of full GC Events.
-gcold Option:old and Permanent Generation Statistics
Columndescription
Pc
Current permanent space Capacity (KB).
Pu
Permanent Space Utilization (KB).
Oc
Current old space Capacity (KB).
OU
Old space Utilization (KB).
Ygc
Number of young generation GC events.
FGC
Number of full GC events.
Fgct
Full garbage collection time.
GCT
Total garbage collection time.
-gcoldcapacity Option:old Generation Statistics
Columndescription
Ogcmn
Minimum old generation Capacity (KB).
Ogcmx
Maximum old generation Capacity (KB).
OGC
Current old generation capacity (KB).
Oc
Current old space Capacity (KB).
Ygc
Number of young generation GC events.
FGC
Number of full GC events.
Fgct
Full garbage collection time.
GCT
Total garbage collection time.
-gcpermcapacity option:permanent Generation Statistics
Columndescription
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
Number of young generation GC events.
FGC
Number of full GC events.
Fgct
Full garbage collection time.
GCT
Total garbage collection time.
-gcutil option:summary of Garbage Collection Statistics
Columndescription
S0
Survivor Space 0 Utilization as a percentage of the space ' s current capacity.
S1
Survivor Space 1 Utilization as a percentage of the space ' s current capacity.
E
Eden space utilization As a percentage of the space ' s current capacity.
O
Old space utilization as a percentage of the space's current capacity.
P
Permanent space utilization As a percentage of the space ' s current capacity.
Ygc
Number of young generation GC events.
Ygct
Young generation garbage collection time.
FGC
Number of full GC events.
Fgct
Full garbage collection time.
GCT
Total garbage collection time.
-printcompilation option:hotspot Compiler Method Statistics
Columndescription
Compiled
Number of compilation tasks performed.
Size
Number of bytes of bytecode for the method.
Type
Compilation type.
Method
Class name and method name identifying the compiled method. Class name uses "/" instead of "." As namespace separator. Method name is the method within the given class. The format for these, consistent, and the hotspot-xx:+printcomplation option.
Java command simple view JVM memory usage