1. 程式人生 > >jmap -heap 命令結果分析

jmap -heap 命令結果分析

先用jps命令找到程序ID

jmap -heap pid

Attaching to process ID 3764, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.171-b11

using thread-local object allocation.
Parallel GC with 8 thread(s) //採用Parallel GC 

Heap Configuration:
   MinHeapFreeRatio         = 0    //JVM最小空閒比率 可由-XX:MinHeapFreeRatio=<n>引數設定, jvm heap 在使用率小於 n 時 ,heap 進行收縮
   MaxHeapFreeRatio         = 100  //JVM最大空閒比率 可由-XX:MaxHeapFreeRatio=<n>引數設定, jvm heap 在使用率大於 n 時 ,heap 進行擴張 
   MaxHeapSize              = 2095054848 (1998.0MB) //JVM堆的最大大小 可由-XX:MaxHeapSize=<n>引數設定
   NewSize                  = 44040192 (42.0MB) //JVM新生代的預設大小 可由-XX:NewSize=<n>引數設定
   MaxNewSize               = 698351616 (666.0MB) //JVM新生代的最大大小 可由-XX:MaxNewSize=<n>引數設定
   OldSize                  = 88080384 (84.0MB) //JVM老生代的預設大小 可由-XX:OldSize=<n>引數設定 
   NewRatio                 = 2 //新生代:老生代(的大小)=1:2 可由-XX:NewRatio=<n>引數指定New Generation與Old Generation heap size的比例。
   SurvivorRatio            = 8 //survivor:eden = 1:8,即survivor space是新生代大小的1/(8+2)[因為有兩個survivor區域] 可由-XX:SurvivorRatio=<n>引數設定
   MetaspaceSize            = 21807104 (20.796875MB) //元空間的預設大小,超過此值就會觸發Full GC 可由-XX:MetaspaceSize=<n>引數設定
   CompressedClassSpaceSize = 1073741824 (1024.0MB) //類指標壓縮空間的預設大小 可由-XX:CompressedClassSpaceSize=<n>引數設定
   MaxMetaspaceSize         = 17592186044415 MB //元空間的最大大小 可由-XX:MaxMetaspaceSize=<n>引數設定
   G1HeapRegionSize         = 0 (0.0MB) //使用G1垃圾收集器的時候,堆被分割的大小 可由-XX:G1HeapRegionSize=<n>引數設定

Heap Usage:
PS Young Generation //新生代區域分配情況
Eden Space: //Eden區域分配情況
   capacity = 89653248 (85.5MB)
   used     = 8946488 (8.532035827636719MB)
   free     = 80706760 (76.96796417236328MB)
   9.978989272089729% used
From Space: //其中一個Survivor區域分配情況
   capacity = 42467328 (40.5MB)
   used     = 15497496 (14.779563903808594MB)
   free     = 26969832 (25.720436096191406MB)
   36.49275037977431% used
To Space:  //另一個Survivor區域分配情況
   capacity = 42991616 (41.0MB)
   used     = 0 (0.0MB)
   free     = 42991616 (41.0MB)
   0.0% used
PS Old Generation //老生代區域分配情況
   capacity = 154664960 (147.5MB)
   used     = 98556712 (93.99100494384766MB)
   free     = 56108248 (53.508995056152344MB)
   63.722715216167906% used

1819 interned Strings occupying 163384 bytes.