0.00,real=0.01 secs]
Exception in thread "main"java.lang.OutOfMemoryError: Java heap space
? ? atcom.gc.EasyParNew.(EasyParNew.java:12)
? ? atcom.gc.EasyParNew.outOfMemoryByExpansionSize(EasyParNew.java:39)
? ? atcom.gc.EasyParNew.main(EasyParNew.java:14)
Heap
?def new generation? total 9216K, used 9152K [0x03b70000,0x04570000, 0x04570000)
?eden space 8192K, 100% used [0x03b70000, 0x04370000, 0x04370000)
?from space 1024K,? 93% used[0x04470000, 0x045600f0, 0x04570000)
?to? space 1024K,? 0% used [0x04370000, 0x04370000, 0x04470000)
?tenured generation? total 92160K, used 92151K [0x04570000,0x09f70000, 0x09f70000)
? the space 92160K,? 99% used[0x04570000, 0x09f6de68, 0x09f6e000, 0x09f70000)
?compacting perm gen? total 12288K, used 2105K [0x09f70000,0x0ab70000, 0x0df70000)
?
结果分析
[GC [DefNew: 9149K->964K(9216K),0.0050408 secs][Tenured: 23320K->23388K(23424K), 0.0030744 secs]24337K->24284K(32640K), [Perm : 2086K->2086K(12288K)], 0.0082092 secs][Times: user=0.00 sys=0.00, real=0.01 secs]
Tenured:23320K->23388K(23424K) ,老年代在回收垃圾(本代码用来做内存溢出是好手…),空间没有了,但是JVM最大划分了100M,可以继续调配空间。于是又来了第二次:
[GC [DefNew: 9104K->962K(9216K),0.0053368 secs][Tenured: 78465K->78531K(78540K), 0.0035892 secs]79431K->79427K(87756K), [Perm : 2086K->2086K(12288K)], 0.0090187 secs][Times: user=0.00 sys=0.00, real=0.01 secs]
Tenured: 78465K->78531K(78540K) ,老年代空间明显变大了… 很快,100M空间就用完了
用[Full GC[Tenured: 92157K->92157K(92160K), 0.0044209 secs] 101264K->101260K(101376K),[Perm : 2084K->2084K(12288K)], 0.0044763 secs] [Times: user=0.00 sys=0.00,real=0.00 secs]进行强力回收,也没有用,于是挂掉了…