Article From:https://www.cnblogs.com/yifanSJ/p/9531275.html

1. jstat

jstat -gcutil 67008 5s 3

Look at the percentage of total capacity occupied by each region in the heap memory of PID 67008 process.

5Refresh every second, inquire 3 times.

The results are as follows:

Explain:

  • S0: Survivor0(The new generation of Survivor) is empty.
  • S1: Survivor1(The new generation of Survivor) is empty.
  • E: Eden(New generation Eden) occupying 0.38%
  • O: Old(Old age takes up 48.24%
  • M:
  • CCS:
  • YGC: Young GC==> Minor GC ==> The number of Cenozoic GC
  • YGCT: YGC It takes 0.578 seconds.
  • FGC: Full GC==>Number of elderly generation GC
  • FGCT: FGCThe total time is 1.067 seconds.
  • GCT: All GC takes 1.645 seconds.

2. jinfo

jinfo -flags process_id

View the parameters of JVM

3. jmap

jmap -heap 1234  (1234Process number)

Print heap information

-heap:Print the outline of heap space, here we can roughly check the usage of heap space.

Example:
jmap -heap 12345
Output:
Attaching to process ID 2657, please wait…
Debugger attached successfully.
Client compiler detected.
JVM version is 1.5.0_16-b02
 
using thread-local object allocation.
Mark Sweep Compact GC
 
Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 67108864 (64.0MB)
   NewSize          = 655360 (0.625MB)
   MaxNewSize       = 4294901760 (4095.9375MB)
   OldSize          = 1441792 (1.375MB)
   NewRatio         = 12
   SurvivorRatio    = 8
   PermSize         = 8388608 (8.0MB)
   MaxPermSize      = 67108864 (64.0MB)
 
Heap Usage:
New Generation (Eden + 1 Survivor Space):—————————————-Cenozoic area
   capacity = 4521984 (4.3125MB)
   used     = 1510200 (1.4402389526367188MB)
   free     = 3011784 (2.8722610473632812MB)
   33.39684527853261% used
Eden Space:--------------------------------------------------------------------Eden Park

   capacity = 4063232 (3.875MB)
   used     = 1495992 (1.4266891479492188MB)
   free     = 2567240 (2.4483108520507812MB)
   36.81778446320565% used
From Space:-------------------------------------------------------------------Young generation (survivor Park 1)

   capacity = 458752 (0.4375MB)
   used     = 14208 (0.0135498046875MB)
   free     = 444544 (0.4239501953125MB)
   3.0970982142857144% used
To Space:—————————————————————————–Young generation (survivor Park 2)
   capacity = 458752 (0.4375MB)
   used     = 0 (0.0MB)
   free     = 458752 (0.4375MB)
   0.0% used

concurrent mark-sweep generation:————————————————-Old age
capacity = 8589934592 (8192.0MB)
used = 0 (0.0MB)
free = 8589934592 (8192.0MB)
0.0% used

Perm Generation:———————————————————————-Permanent generation
   capacity = 11796480 (11.25MB)
   used     = 11712040 (11.169471740722656MB)
   free     = 84440 (0.08052825927734375MB)
   99.28419325086806% used

-histo:A statistical report of classes is generated, which is extremely simple, such as showing what classes have many instances, how many bytes in total, and so on.

Size    Count   Class description
——————————————————-
8394352 105     long[]
8293192 57202   char[]
7834776 14157   byte[]
6713592 53743   * ConstMethodKlass
4194320 1       com.xjawa.cms5server.Kontent[]
4055072 12319   int[]
3291104 85082   * SymbolKlass
3016040 53743   * MethodKlass
2774936 4253    * ConstantPoolKlass
1871480 4253    * InstanceKlassKlass
1811808 3990    * ConstantPoolCacheKlass
1488672 62028   java.lang.String
1203280 13258   java.lang.Object[]

 

Link of this Article: JVM comes with monitoring tools.

Leave a Reply

Your email address will not be published. Required fields are marked *