`

hotspot垃圾收集器

    博客分类:
  • JVM
 
阅读更多
测试代码
	public void test()throws Exception {
		while(true) {
			byte[] buf = new byte[3 * 1024 * 1024];
			Thread.sleep(500);
			//System.gc();	
		}	
	}


使用serial + serial Old
full gc通过(System.gc())触发
年轻代垃垃圾收集器名字 DefNew
老年代Tenured 持久带 Perm

年轻代收集过程
C:\>java -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:+ScavengeBeforeFullGC -
XX:+UseSerialGC Test2
[GC [DefNew: 6471K->146K(9216K), 0.0043318 secs] 6471K->146K(19456K), 0.0053627
secs] [Times: user=0.00 sys=0.02, real=0.01 secs]
[GC [DefNew: 6540K->146K(9216K), 0.0022464 secs] 6540K->146K(19456K), 0.0032348
secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
Heap
 def new generation   total 9216K, used 3546K [0x315e0000, 0x31fe0000, 0x31fe000
0)
  eden space 8192K,  41% used [0x315e0000, 0x31931f28, 0x31de0000)
  from space 1024K,  14% used [0x31de0000, 0x31e04920, 0x31ee0000)
  to   space 1024K,   0% used [0x31ee0000, 0x31ee0000, 0x31fe0000)
 tenured generation   total 10240K, used 0K [0x31fe0000, 0x329e0000, 0x329e0000)

   the space 10240K,   0% used [0x31fe0000, 0x31fe0000, 0x31fe0200, 0x329e0000)
 compacting perm gen  total 12288K, used 374K [0x329e0000, 0x335e0000, 0x369e000
0)
   the space 12288K,   3% used [0x329e0000, 0x32a3dba0, 0x32a3dc00, 0x335e0000)
    ro space 10240K,  54% used [0x369e0000, 0x36f5ee00, 0x36f5ee00, 0x373e0000)
    rw space 12288K,  55% used [0x373e0000, 0x37a82800, 0x37a82800, 0x37fe0000)


从jstat看,只触发了YGC
C:\>jstat -gcutil 2528 1000 20
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT
 14.29   0.00  37.50   0.00   3.04     12    0.029     0    0.000    0.029
  0.00  14.29  37.50   0.00   3.04     13    0.032     0    0.000    0.032
 14.29   0.00  37.50   0.00   3.04     14    0.034     0    0.000    0.034
  0.00  14.29  37.50   0.00   3.04     15    0.036     0    0.000    0.036
  0.01   0.00  37.50   1.43   3.04     16    0.038     0    0.000    0.038
  0.00   0.00  37.50   1.43   3.04     17    0.040     0    0.000    0.040
  0.00   0.00  37.50   1.43   3.04     18    0.041     0    0.000    0.041
  0.00   0.00  37.50   1.43   3.04     19    0.042     0    0.000    0.042
  0.00   0.00  37.50   1.43   3.04     20    0.043     0    0.000    0.043
  0.00   0.00  37.50   1.43   3.04     21    0.044     0    0.000    0.044
  0.00   0.00  37.50   1.43   3.04     22    0.044     0    0.000    0.044


老年代和持久带的收集过程
C:\>java -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:+ScavengeBeforeFullGC -
XX:PretenureSizeThreshold=2097152 -XX:+UseSerialGC Test2
[GC [Tenured: 9216K->146K(10240K), 0.0310260 secs] 9543K->146K(19456K), [Perm :
373K->373K(12288K)], 0.0322100 secs] [Times: user=0.03 sys=0.00, real=0.03 secs]

[GC [Tenured: 9362K->146K(10240K), 0.0238268 secs] 12762K->146K(19456K), [Perm :
 373K->373K(12288K)], 0.0256443 secs] [Times: user=0.02 sys=0.00, real=0.01 secs
]
Heap
 def new generation   total 9216K, used 3563K [0x315e0000, 0x31fe0000, 0x31fe000
0)
  eden space 8192K,  43% used [0x315e0000, 0x3195ae88, 0x31de0000)
  from space 1024K,   0% used [0x31de0000, 0x31de0000, 0x31ee0000)
  to   space 1024K,   0% used [0x31ee0000, 0x31ee0000, 0x31fe0000)
 tenured generation   total 10240K, used 3218K [0x31fe0000, 0x329e0000, 0x329e00
00)
   the space 10240K,  31% used [0x31fe0000, 0x32304a00, 0x32304a00, 0x329e0000)
 compacting perm gen  total 12288K, used 374K [0x329e0000, 0x335e0000, 0x369e000
0)
   the space 12288K,   3% used [0x329e0000, 0x32a3dba0, 0x32a3dc00, 0x335e0000)
    ro space 10240K,  54% used [0x369e0000, 0x36f5ee00, 0x36f5ee00, 0x373e0000)
    rw space 12288K,  55% used [0x373e0000, 0x37a82800, 0x37a82800, 0x37fe0000)


只触发了FGC,但是却没有YGC
C:\>jstat -gcutil 2572 1000 20
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT
  0.00   0.00  39.50  31.43   3.04      0    0.000    23    0.621    0.621
  0.00   0.00  39.50  31.43   3.04      0    0.000    25    0.675    0.675
  0.00   0.00  39.50  31.43   3.04      0    0.000    27    0.728    0.728
  0.00   0.00  39.50  31.43   3.04      0    0.000    29    0.782    0.782
  0.00   0.00  39.50  31.43   3.04      0    0.000    31    0.837    0.837
  0.00   0.00  39.50  31.30   3.00      0    0.000    33    0.891    0.891



如果开启Syste.gc(),也是一样,只有FGC,没有YGC
C:\>java -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:+ScavengeBeforeFullGC -
XX:PretenureSizeThreshold=2097152 -XX:+UseSerialGC Test2
[Full GC (System) [Tenured: 3072K->3218K(10240K), 0.0281815 secs] 3399K->3218K(1
9456K), [Perm : 373K->373K(12288K)], 0.0297979 secs] [Times: user=0.03 sys=0.00,
 real=0.03 secs]
[Full GC (System) [Tenured: 3218K->3218K(10240K), 0.0269135 secs] 6618K->3218K(1
9456K), [Perm : 373K->373K(12288K)], 0.0280661 secs] [Times: user=0.02 sys=0.00,
 real=0.03 secs]
Heap
 def new generation   total 9216K, used 3563K [0x315e0000, 0x31fe0000, 0x31fe000
0)
  eden space 8192K,  43% used [0x315e0000, 0x3195ae88, 0x31de0000)
  from space 1024K,   0% used [0x31de0000, 0x31de0000, 0x31ee0000)
  to   space 1024K,   0% used [0x31ee0000, 0x31ee0000, 0x31fe0000)
 tenured generation   total 10240K, used 3218K [0x31fe0000, 0x329e0000, 0x329e00
00)
   the space 10240K,  31% used [0x31fe0000, 0x32304930, 0x32304a00, 0x329e0000)
 compacting perm gen  total 12288K, used 374K [0x329e0000, 0x335e0000, 0x369e000
0)
   the space 12288K,   3% used [0x329e0000, 0x32a3dbd8, 0x32a3dc00, 0x335e0000)
    ro space 10240K,  54% used [0x369e0000, 0x36f5ee00, 0x36f5ee00, 0x373e0000)
    rw space 12288K,  55% used [0x373e0000, 0x37a82800, 0x37a82800, 0x37fe0000)


C:\>jstat -gcutil 3724 1000 20
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT
  0.00   0.00   0.00  31.43   3.04      0    0.000    20    0.535    0.535
  0.00   0.00  39.50  31.43   3.04      0    0.000    21    0.551    0.551
  0.00   0.00  39.50  31.43   3.04      0    0.000    23    0.604    0.604
  0.00   0.00  39.50  31.43   3.04      0    0.000    25    0.659    0.659
  0.00   0.00  39.50  31.43   3.04      0    0.000    27    0.715    0.715
  0.00   0.00  39.50  31.43   3.04      0    0.000    29    0.768    0.768
  0.00   0.00  39.50  31.43   3.04      0    0.000    31    0.823    0.823




Parallel Scavenge +Parallel Old 组合显示的结果,full gc通过(System.gc())触发,
年轻代收集器名称 PSYoungGen
老年代ParOldGen, 持久带PSPermGen

年轻代的收集过程,只触发YGC
C:\>java -Xmx15M -Xms15M -Xmn10M -XX:+PrintGCDetails -XX:+ScavengeBeforeFullGC -
XX:PretenureSizeThreshold=2097152 -XX:+UseParallelOldGC -XX:ParallelGCThreads=10
 Test2
[GC [PSYoungGen: 4419K->176K(8960K)] 8515K->4272K(15104K), 0.0034451 secs] [Time
s: user=0.03 sys=0.00, real=0.02 secs]
[GC [PSYoungGen: 4425K->168K(8960K)] 8521K->4264K(15104K), 0.0032476 secs] [Time
s: user=0.00 sys=0.00, real=0.00 secs]
Heap
 PSYoungGen      total 8960K, used 4571K [0x06ff0000, 0x079f0000, 0x079f0000)
  eden space 7680K, 57% used [0x06ff0000,0x0743cd38,0x07770000)
  from space 1280K, 13% used [0x078b0000,0x078da030,0x079f0000)
  to   space 1280K, 0% used [0x07770000,0x07770000,0x078b0000)
 ParOldGen       total 6144K, used 4096K [0x069f0000, 0x06ff0000, 0x06ff0000)
  object space 6144K, 66% used [0x069f0000,0x06df0010,0x06ff0000)
 PSPermGen       total 12288K, used 2104K [0x029f0000, 0x035f0000, 0x069f0000)
  object space 12288K, 17% used [0x029f0000,0x02bfe3c8,0x035f0000)


通过程序触发的full gc,此时YGC,FGC都会触发
C:\>java -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:-ScavengeBeforeFullGC
-XX:PretenureSizeThreshold=2097152 -XX:+UseParallelOldGC Test2
[Full GC (System) [PSYoungGen: 3395K->0K(8960K)] [ParOldGen: 0K->3218K(10240K)]
3395K->3218K(19200K) [PSPermGen: 2091K->2091K(12288K)], 0.0317060 secs] [Times:
user=0.05 sys=0.00, real=0.03 secs]

[Full GC (System) [PSYoungGen: 3379K->0K(8960K)] [ParOldGen: 3218K->3218K(10240K
)] 6597K->3218K(19200K) [PSPermGen: 2097K->2097K(12288K)], 0.0238544 secs] [Time
s: user=0.01 sys=0.00, real=0.02 secs]

[Full GC (System) [PSYoungGen: 3225K->0K(8960K)] [ParOldGen: 3218K->3218K(10240K
)] 6443K->3218K(19200K) [PSPermGen: 2097K->2097K(12288K)], 0.0254747 secs] [Time
s: user=0.02 sys=0.00, real=0.02 secs]
Heap
 PSYoungGen      total 8960K, used 3532K [0x073f0000, 0x07df0000, 0x07df0000)
  eden space 7680K, 46% used [0x073f0000,0x077633a0,0x07b70000)
  from space 1280K, 0% used [0x07cb0000,0x07cb0000,0x07df0000)
  to   space 1280K, 0% used [0x07b70000,0x07b70000,0x07cb0000)
 ParOldGen       total 10240K, used 3218K [0x069f0000, 0x073f0000, 0x073f0000)
  object space 10240K, 31% used [0x069f0000,0x06d14928,0x073f0000)
 PSPermGen       total 12288K, used 2104K [0x029f0000, 0x035f0000, 0x069f0000)
  object space 12288K, 17% used [0x029f0000,0x02bfe108,0x035f0000)


Parallel GC的线程名
"GC task thread#0 (ParallelGC)" prio=6 tid=0x0031e000 nid=0x988 runnable




使用ParNew + ConcMarkSweep ,full gc通过(System.gc())触发,

ParNew GC的线程名
"Gang worker#0 (Parallel GC Threads)" prio=10 tid=0x0031bc00 nid=0x604 runnable


CMS线程名
"Concurrent Mark-Sweep GC Thread" prio=10 tid=0x0836e400 nid=0xe18 runnable
"Gang worker#0 (Parallel CMS Threads)" prio=10 tid=0x082cc000 nid=0xd18 runnable



年轻代收集过程,此时只会触发YGC
C:\>java -Xmx20M -Xms20M -Xmn10M -XX:+PrintGCDetails  -XX:+UseConcMarkSweepGC -X
X:ParallelGCThreads=10 Test2
[GC [ParNew: 4423K->168K(9216K), 0.0055490 secs] 4423K->168K(19456K), 0.0062150
secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC [ParNew: 4428K->176K(9216K), 0.0032652 secs] 4428K->176K(19456K), 0.0044014
secs] [Times: user=0.03 sys=0.00, real=0.02 secs]
Heap
 par new generation   total 9216K, used 4600K [0x02e10000, 0x03810000, 0x0381000
0)
  eden space 8192K,  54% used [0x02e10000, 0x03261f28, 0x03610000)
  from space 1024K,  17% used [0x03610000, 0x0363c3c0, 0x03710000)
  to   space 1024K,   0% used [0x03710000, 0x03710000, 0x03810000)
 concurrent mark-sweep generation total 10240K, used 0K [0x03810000, 0x04210000,
 0x04210000)
 concurrent-mark-sweep perm gen total 12288K, used 2104K [0x04210000, 0x04e10000
, 0x08210000)




老年代和持久带收集过程,只会触发FGC
C:\>java -Xmx20M -Xms20M -Xmn10M -XX:+PrintGCDetails  -XX:+UseConcMarkSweepGC -X
X:ParallelGCThreads=10 -XX:PretenureSizeThreshold=2097152 Test2
[GC [CMS: 8192K->146K(10240K), 0.0272448 secs] 8519K->146K(19456K), [CMS Perm :
2091K->2091K(12288K)], 0.0294118 secs] [Times: user=0.01 sys=0.02, real=0.03 sec
s]
[GC [CMS: 8338K->146K(10240K), 0.0229166 secs] 12762K->146K(19456K), [CMS Perm :
 2097K->2097K(12288K)], 0.0248618 secs] [Times: user=0.01 sys=0.00, real=0.01 se
cs]
[GC [1 CMS-initial-mark: 8338K(10240K)] 12519K(19456K), 0.0010387 secs] [Times:
user=0.00 sys=0.00, real=0.00 secs]
[CMS-concurrent-mark: 0.009/0.009 secs] [Times: user=0.03 sys=0.00, real=0.02 se
cs]
[CMS-concurrent-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.0
0 secs]
[GC [CMS[CMS-concurrent-abortable-preclean: 0.000/0.035 secs] [Times: user=0.00
sys=0.00, real=0.03 secs]
 (concurrent mode failure): 8338K->146K(10240K), 0.0236156 secs] 12519K->146K(19
456K), [CMS Perm : 2097K->2097K(12288K)], 0.0257522 secs] [Times: user=0.02 sys=
0.00, real=0.03 secs]
[GC [CMS: 8338K->146K(10240K), 0.0213714 secs] 12491K->146K(19456K), [CMS Perm :
 2097K->2097K(12288K)], 0.0231105 secs] [Times: user=0.03 sys=0.00, real=0.03 se
cs]
[GC [CMS: 8338K->146K(10240K), 0.0224847 secs] 12472K->146K(19456K), [CMS Perm :
 2097K->2097K(12288K)], 0.0243117 secs] [Times: user=0.03 sys=0.00, real=0.03 se
cs]
[GC [CMS: 8338K->146K(10240K), 0.0219254 secs] 12459K->146K(19456K), [CMS Perm :
 2097K->2097K(12288K)], 0.0242763 secs] [Times: user=0.02 sys=0.01, real=0.03 se
cs]
Heap
 par new generation   total 9216K, used 4440K [0x02e10000, 0x03810000, 0x0381000
0)
  eden space 8192K,  54% used [0x02e10000, 0x03266128, 0x03610000)
  from space 1024K,   0% used [0x03610000, 0x03610000, 0x03710000)
  to   space 1024K,   0% used [0x03710000, 0x03710000, 0x03810000)
 concurrent mark-sweep generation total 10240K, used 4242K [0x03810000, 0x042100
00, 0x04210000)
 concurrent-mark-sweep perm gen total 12288K, used 2104K [0x04210000, 0x04e10000
, 0x08210000)



通过System.gc()触发,此时只有FGC,没有YGC
C:\>java -Xmx20M -Xms20M -Xmn10M -XX:+PrintGCDetails  -XX:+UseConcMarkSweepGC -X
X:ParallelGCThreads=10 -XX:PretenureSizeThreshold=2097152 -XX:+ScavengeBeforeFul
lGC Test2
[Full GC (System) [CMS: 4096K->4242K(10240K), 0.0274647 secs] 4423K->4242K(19456
K), [CMS Perm : 2091K->2091K(12288K)], 0.0289805 secs] [Times: user=0.03 sys=0.0
0, real=0.03 secs]
[Full GC (System) [CMS: 4242K->4242K(10240K), 0.0256547 secs] 8666K->4242K(19456
K), [CMS Perm : 2097K->2097K(12288K)], 0.0265903 secs] [Times: user=0.02 sys=0.0
0, real=0.02 secs]
[Full GC (System) [CMS: 4242K->4242K(10240K), 0.0258008 secs] 8423K->4242K(19456
K), [CMS Perm : 2097K->2097K(12288K)], 0.0271459 secs] [Times: user=0.02 sys=0.0
0, real=0.01 secs]
Heap
 par new generation   total 9216K, used 4480K [0x02e10000, 0x03810000, 0x0381000
0)
  eden space 8192K,  54% used [0x02e10000, 0x032700b0, 0x03610000)
  from space 1024K,   0% used [0x03610000, 0x03610000, 0x03710000)
  to   space 1024K,   0% used [0x03710000, 0x03710000, 0x03810000)
 concurrent mark-sweep generation total 10240K, used 4242K [0x03810000, 0x042100
00, 0x04210000)
 concurrent-mark-sweep perm gen total 12288K, used 2104K [0x04210000, 0x04e10000
, 0x08210000)



CMS中有,初始化,并发标记,重新标记,并发清除几个阶段

以下是初始化,并发标记
C:\>java -Xmx15M -Xms15M -Xmn10M -XX:+PrintGCDetails  -XX:+UseConcMarkSweepGC -X
X:ParallelGCThreads=10 -XX:PretenureSizeThreshold=2097152 -XX:+ScavengeBeforeFul
lGC Test2


[GC [1 CMS-initial-mark: 4242K(6144K)] 4242K(15360K), 0.0007012 secs] [Times: us
er=0.00 sys=0.00, real=0.00 secs]
[CMS-concurrent-mark: 0.009/0.009 secs] [Times: user=0.02 sys=0.01, real=0.02 se
cs]


重新标记,并发清除
[GC[YG occupancy: 4106 K (9216 K)][Rescan (parallel) , 0.0013488 secs][weak refs
 processing, 0.0000218 secs] [1 CMS-remark: 4242K(6144K)] 8349K(15360K), 0.00288
98 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
[CMS-concurrent-sweep: 0.000/0.000 secs] [Times: user=0.01 sys=0.00, real=0.01 s
ecs]
[CMS-concurrent-reset: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 s
ecs]


此外还有扫描中断:
[Full GC (System) [CMS[CMS-concurrent-abortable-preclean: 0.001/0.499 secs] [Tim
es: user=0.00 sys=0.00, real=0.50 secs]
 (concurrent mode interrupted): 4242K->4242K(6144K), 0.0266688 secs] 8363K->4242
K(15360K), [CMS Perm : 2097K->2097K(12288K)], 0.0283159 secs] [Times: user=0.03
sys=0.00, real=0.03 secs]


处理失败的情况,此时使用serial old:
 (concurrent mode failure): 8338K->146K(10240K), 0.0260159 secs] 12519K->146K(19
456K), [CMS Perm : 2097K->2097K(12288K)], 0.0277560 secs] [Times: user=0.02 sys=
0.01, real=0.03 secs]






最后是G1,其线程名如下:

"Gang worker#0 (Parallel GC Threads)" prio=10 tid=0x08a4f800 nid=0x108d runnable 

"G1 Main Concurrent Mark GC Thread" prio=10 tid=0x08a6a400 nid=0x1090 runnable 

"Gang worker#0 (G1 Parallel Marking Threads)" prio=10 tid=0x08a7bc00 nid=0x1091 runnable 

"G1 Concurrent Refinement Thread#0" prio=10 tid=0x08a62800 nid=0x108f runnable 

"G1 Concurrent Refinement Thread#1" prio=10 tid=0x08a61000 nid=0x108e runnable 



清扫过程:由于G1不能很好的和jstat配合工作,因此看不到gcutil情况
[GC pause (young), 0.00875300 secs]
   [Parallel Time:   8.6 ms]
      [GC Worker Start Time (ms):  19253.4]
      [Update RS (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Processed Buffers : 0
          Sum: 0, Avg: 0, Min: 0, Max: 0]
      [Ext Root Scanning (ms):  7.5
       Avg:   7.5, Min:   7.5, Max:   7.5]
      [Mark Stack Scanning (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Scan RS (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Object Copy (ms):  0.1
       Avg:   0.1, Min:   0.1, Max:   0.1]
      [Termination (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Termination Attempts : 1
          Sum: 1, Avg: 1, Min: 1, Max: 1]
      [GC Worker End Time (ms):  19261.2]
      [Other:   0.9 ms]
   [Clear CT:   0.0 ms]
   [Other:   0.1 ms]
      [Choose CSet:   0.0 ms]
   [ 12M->12M(20M)]
 [Times: user=0.00 sys=0.00, real=0.01 secs] 
[Full GC 12M->114K(20M), 0.0280980 secs]
 [Times: user=0.02 sys=0.00, real=0.02 secs] 
[GC pause (young), 0.00837900 secs]
   [Parallel Time:   8.1 ms]
      [GC Worker Start Time (ms):  21412.9]
      [Update RS (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Processed Buffers : 0
          Sum: 0, Avg: 0, Min: 0, Max: 0]
      [Ext Root Scanning (ms):  6.8
       Avg:   6.8, Min:   6.8, Max:   6.8]
      [Mark Stack Scanning (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Scan RS (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Object Copy (ms):  0.1
       Avg:   0.1, Min:   0.1, Max:   0.1]
      [Termination (ms):  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Termination Attempts : 1
          Sum: 1, Avg: 1, Min: 1, Max: 1]
      [GC Worker End Time (ms):  21419.9]
      [Other:   1.1 ms]
   [Clear CT:   0.1 ms]
   [Other:   0.1 ms]
      [Choose CSet:   0.0 ms]
   [ 12M->12M(20M)]
 [Times: user=0.00 sys=0.00, real=0.01 secs] 
[Full GC 12M->101K(20M), 0.0368190 secs]
 [Times: user=0.04 sys=0.00, real=0.02 secs] 
Heap
 garbage-first heap   total 20480K, used 8293K [0xaff00000, 0xb1300000, 0xb1300000)
  region size 1024K, 1 young (1024K), 0 survivors (0K)
 compacting perm gen  total 12288K, used 1724K [0xb1300000, 0xb1f00000, 0xb5300000)
   the space 12288K,  14% used [0xb1300000, 0xb14af300, 0xb14af400, 0xb1f00000)
No shared spaces configured.




jdk1.7.0_04 打开G1,jstat,jmap等工具可以正常使用。
C:\jdk1.7.0_04\bin>java -Xmx20M -Xms20M -Xmn10M -XX:+UseG1GC -XX:+PrintGCDet
ails Test2
[GC pause (young) (initial-mark), 0.00661676 secs]
   [Parallel Time:   5.7 ms]
      [GC Worker Start (ms):  747.9  747.9
       Avg: 747.9, Min: 747.9, Max: 747.9, Diff:   0.0]
      [Ext Root Scanning (ms):  2.1  1.9
       Avg:   2.0, Min:   1.9, Max:   2.1, Diff:   0.2]
      [Update RS (ms):  0.0  0.1
       Avg:   0.1, Min:   0.0, Max:   0.1, Diff:   0.1]
         [Processed Buffers : 0 5
          Sum: 5, Avg: 2, Min: 0, Max: 5, Diff: 5]
      [Scan RS (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
      [Object Copy (ms):  3.3  3.3
       Avg:   3.3, Min:   3.3, Max:   3.3, Diff:   0.1]
      [Termination (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
         [Termination Attempts : 1 1
          Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]
      [GC Worker End (ms):  753.4  753.4
       Avg: 753.4, Min: 753.4, Max: 753.4, Diff:   0.0]
      [GC Worker (ms):  5.5  5.5
       Avg:   5.5, Min:   5.5, Max:   5.5, Diff:   0.0]
      [GC Worker Other (ms):  0.3  0.3
       Avg:   0.3, Min:   0.3, Max:   0.3, Diff:   0.0]
   [Clear CT:   0.0 ms]
   [Other:   0.9 ms]
      [Choose CSet:   0.0 ms]
      [Ref Proc:   0.1 ms]
      [Ref Enq:   0.0 ms]
      [Free CSet:   0.0 ms]
   [Eden: 1024K(10M)->0B(9216K) Survivors: 0B->1024K Heap: 4663K(20M)->4560K(20M
)]
 [Times: user=0.03 sys=0.00, real=0.02 secs]
[GC concurrent-root-region-scan-start]
[GC concurrent-root-region-scan-end, 0.0019206]
[GC concurrent-mark-start]
[GC concurrent-mark-end, 0.0012521 sec]
[GC remark [GC ref-proc, 0.0000235 secs], 0.0031993 secs]
 [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC cleanup 8697K->4601K(20M), 0.0008915 secs]
 [Times: user=0.00 sys=0.02, real=0.02 secs]
[GC concurrent-cleanup-start]
[GC concurrent-cleanup-end, 0.0004232]
[GC pause (young) (initial-mark), 0.00516323 secs]
   [Parallel Time:   4.3 ms]
      [GC Worker Start (ms):  1281.0  1281.0
       Avg: 1281.0, Min: 1281.0, Max: 1281.0, Diff:   0.0]
      [Ext Root Scanning (ms):  1.5  1.4
       Avg:   1.4, Min:   1.4, Max:   1.5, Diff:   0.1]
      [Update RS (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
         [Processed Buffers : 0 2
          Sum: 2, Avg: 1, Min: 0, Max: 2, Diff: 2]
      [Scan RS (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
      [Object Copy (ms):  2.7  2.7
       Avg:   2.7, Min:   2.7, Max:   2.7, Diff:   0.0]
      [Termination (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
         [Termination Attempts : 1 1
          Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]
      [GC Worker End (ms):  1285.2  1285.2
       Avg: 1285.2, Min: 1285.2, Max: 1285.2, Diff:   0.0]
      [GC Worker (ms):  4.2  4.2
       Avg:   4.2, Min:   4.2, Max:   4.2, Diff:   0.0]
      [GC Worker Other (ms):  0.1  0.1
       Avg:   0.1, Min:   0.1, Max:   0.1, Diff:   0.0]
   [Clear CT:   0.0 ms]
   [Other:   0.9 ms]
      [Choose CSet:   0.0 ms]
      [Ref Proc:   0.1 ms]
      [Ref Enq:   0.0 ms]
      [Free CSet:   0.0 ms]
   [Eden: 1024K(9216K)->0B(9216K) Survivors: 1024K->1024K Heap: 4601K(20M)->4544
K(20M)]
 [Times: user=0.03 sys=0.00, real=0.03 secs]
[GC concurrent-root-region-scan-start]
[GC concurrent-root-region-scan-end, 0.0016821]
[GC concurrent-mark-start]
[GC concurrent-mark-end, 0.0005808 sec]
[GC remark [GC ref-proc, 0.0000212 secs], 0.0029291 secs]
 [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC cleanup 8640K->4544K(20M), 0.0008895 secs]
 [Times: user=0.00 sys=0.00, real=0.02 secs]
[GC concurrent-cleanup-start]
[GC concurrent-cleanup-end, 0.0005897]
[GC pause (young) (initial-mark), 0.00520737 secs]
   [Parallel Time:   4.3 ms]
      [GC Worker Start (ms):  1812.2  1812.2
       Avg: 1812.2, Min: 1812.2, Max: 1812.2, Diff:   0.0]
      [Ext Root Scanning (ms):  1.5  1.3
       Avg:   1.4, Min:   1.3, Max:   1.5, Diff:   0.2]
      [Update RS (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
         [Processed Buffers : 0 0
          Sum: 0, Avg: 0, Min: 0, Max: 0, Diff: 0]
      [Scan RS (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
      [Object Copy (ms):  2.6  2.8
       Avg:   2.7, Min:   2.6, Max:   2.8, Diff:   0.2]
      [Termination (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0, Diff:   0.0]
         [Termination Attempts : 1 1
          Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]
      [GC Worker End (ms):  1816.4  1816.4
       Avg: 1816.4, Min: 1816.4, Max: 1816.4, Diff:   0.0]
      [GC Worker (ms):  4.2  4.2
       Avg:   4.2, Min:   4.2, Max:   4.2, Diff:   0.0]
      [GC Worker Other (ms):  0.1  0.1
       Avg:   0.1, Min:   0.1, Max:   0.1, Diff:   0.0]
   [Clear CT:   0.0 ms]
   [Other:   0.9 ms]
      [Choose CSet:   0.0 ms]
      [Ref Proc:   0.1 ms]
      [Ref Enq:   0.0 ms]
      [Free CSet:   0.0 ms]
   [Eden: 0B(9216K)->0B(9216K) Survivors: 1024K->1024K Heap: 4544K(20M)->4544K(2
0M)]
 [Times: user=0.03 sys=0.00, real=0.03 secs]
[GC concurrent-root-region-scan-start]
[GC concurrent-root-region-scan-end, 0.0014873]
[GC concurrent-mark-start]
[GC concurrent-mark-end, 0.0006668 sec]
[GC remark [GC ref-proc, 0.0000263 secs], 0.0028615 secs]
 [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC cleanup 8640K->4544K(20M), 0.0007965 secs]
 [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC concurrent-cleanup-start]
[GC concurrent-cleanup-end, 0.0006168]
Heap
 garbage-first heap   total 20480K, used 4544K [0x02d00000, 0x04100000, 0x041000
00)
  region size 1024K, 2 young (2048K), 1 survivors (1024K)
 compacting perm gen  total 12288K, used 1572K [0x04100000, 0x04d00000, 0x081000
00)
   the space 12288K,  12% used [0x04100000, 0x042893d0, 0x04289400, 0x04d00000)
No shared spaces configured.




参考
Tenured 区并发垃圾回收器CMS介绍
http://blog.csdn.net/lxb_champagne/article/details/18357947

千丝万缕的FGC与Buffer Pool
http://fx114.net/qa-132-149018.aspx




分享到:
评论

相关推荐

    性能工程师指南:玩转OpenJDK HotSpot垃圾收集器.ppt

    性能工程师指南:玩转OpenJDK HotSpot垃圾收集器.ppt性能工程师指南:玩转OpenJDK HotSpot垃圾收集器.ppt性能工程师指南:玩转OpenJDK HotSpot垃圾收集器.ppt性能工程师指南:玩转OpenJDK HotSpot垃圾收集器.ppt性能...

    性能工程师指南:玩转OpenJDK HotSpot垃圾收集器(83页).pdf

    性能工程师指南:玩转OpenJDK HotSpot垃圾收集器(83页).pdf

    性能工程师指南:玩转OpenJDK HotSpot垃圾收集器

    Performance Engineering Performance Requirements & Test Plan & Development Performance Analysis

    JVM核心知识学习和整理.docx

    JVM,JVM内存结构、HotSpot 虚拟机对象探秘、垃圾收集策略与算法、HotSpot 垃圾收集器、内存分配与回收策略、JVM 性能调优、类文件结构。。

    垃圾收集器可视化工具gcviz.zip

    gcviz 是垃圾收集器可视化工具/框架。gcviz 是帮助生成 gc.log 可视化的程序集合。HotSpot,一个 Java 可视化机制,用以下标记配置: -verbose:gc -verbose:sizes -Xloggc:/apps/tomcat/logs/gc.log -XX: ...

    HotSpot实战高清版本

    Cache、Perf Data、Crash 分析方法、转储分析方法、 垃圾收集器的设计演进、CMS 和 G1 收集器、栈、JVM 对硬件寄存器的利用、栈顶缓存技术、解释器、字节 码表、转发表、Stubs、Code Cache、Code 生成器、JIT 编译器...

    HotSpot实战

    包括OpenJDK与HotSpot项目、编译和调试HotSpot的方法、HotSpot内核结构、Launcher、OOP-Klass对象表示系统、链接、运行时数据区、方法区、常量池和常量池Cache、Perf Data、Crash分析方法、转储分析方法、垃圾收集器...

    Java垃圾收集基础知识-官方版本

    本教程介绍了垃圾收集如何与Hotspot JVM一起使用的基础知识。了解垃圾收集器的工作原理后,学习如何使用Visual VM监视垃圾收集过程。最后,了解Java SE 7 Hotspot JVM中可用的垃圾收集器。

    Hotspot VM源码

    HotSpot正是目前世界上java虚拟机的最好的实现。 HotSpot的基础代码是许多人辛勤劳动的结晶,这个过程迄今已持续了超过10年的时间(当然...当然还有大约3个垃圾收集器以及一系列用来实现同步的高性能运行库文件等等。

    降低Java垃圾回收开销的5条建议

     随着垃圾收集器的发展,每一代 GC 与其上一代相比,都带来了巨大的进步和改善。parallel GC 与 serial GC 相比,它让垃圾收集器以多线程的方式工作,充分利用了多核计算机的计算能力。CMS(“Concurrent Mark-...

    JAVA虚拟机精讲

    比如:字节码的编译原理、字节码的内部组成结构、通过源码的方式剖析HotSpot VM 的启动过程和初始化过程、Java 虚拟机的运行时内存、垃圾收集算法、垃圾收集器(重点讲解了Serial 收集器、ParNew 收集器、Parallel ...

    Jvm性能优化-JVM内存结构原理分析03

    Jvm中有多种垃圾收集器,如串行(Serial)垃圾收集器、并行(Parallel)垃圾收集器、并发(Concurrent)垃圾收集器等。其中,串行垃圾收集器是Jvm默认的垃圾收集器,它使用单线程来执行垃圾回收。并行垃圾收集器使用...

    Java虚拟机精讲.高翔龙.带书签完整版.pdf

    本书以极其精练的语句诠释了HotSpot VM 的方方面面,比如:字节码的编译原理、字节码的内部组成结构、通过源码的方式剖析HotSpot VM 的启动过程和初始化过程、Java 虚拟机的运行时内存、垃圾收集算法、垃圾收集器...

    JAVA虚拟机精讲 pdf

    本书以极其精练的语句诠释了HotSpot VM 的方方面面,比如:字节码的编译原理、字节码的内部组成结构、通过源码的方式剖析HotSpot VM 的启动过程和初始化过程、Java 虚拟机的运行时内存、垃圾收集算法、垃圾收集器...

    java虚拟机精讲(电子工业出版社出版)

    本书以极其精练的语句诠释了 HotSpot VM的方方面面,比如:字节码的编译原理、字节码的内部组成结构、通过源码的方式剖析 HotSpot VM 的启动过程和初始化过程、Java 虚拟机的运行时内存、垃圾收集算法、垃圾收集器...

    jdk-10.0.1_linux-x64bit rpm格式CSDN下载

    一个干净的垃圾收集器接口,用来改善垃圾收集器源代码之间的隔离效果,这样可以为HotSpot 虚拟机中的内部垃圾收集代码提供更好的模块化功能,也可以更容易向 HotSpot 添加新的垃圾收集器。 并行、完整的 G1 垃圾...

    jdk-10.0.1_windows-x64bit CSDN下载

    一个干净的垃圾收集器接口,用来改善垃圾收集器源代码之间的隔离效果,这样可以为HotSpot 虚拟机中的内部垃圾收集代码提供更好的模块化功能,也可以更容易向 HotSpot 添加新的垃圾收集器。 并行、完整的 G1 垃圾...

    jdk-10.0.1_linux-x64bit gz格式CSDN下载

    一个干净的垃圾收集器接口,用来改善垃圾收集器源代码之间的隔离效果,这样可以为HotSpot 虚拟机中的内部垃圾收集代码提供更好的模块化功能,也可以更容易向 HotSpot 添加新的垃圾收集器。 并行、完整的 G1 垃圾...

    深入理解Java虚拟机笔记(带目录).docx

    GC 日志用于记录垃圾收集器的执行情况,可以用于调试和优化垃圾收集器。 内存分配 Java 中的内存分配可以分为以下几种: * 栈上分配(Stack Allocation):在栈上分配内存。 * 堆上分配(Heap Allocation):在堆...

Global site tag (gtag.js) - Google Analytics