即使Old Generation没有填满,也会持续完整GC

时间:2011-02-04 18:35:17

标签: java garbage-collection jvm-hotspot

每隔几天我们就会看到连续的Full GC(超过1000个FullGC)然后应用程序正常......详细的GC日志如下所示..当它执行Full GC时,旧一代没有填满..但是什么促使这个Full Gc ??

环境/设置

JDK 1.6
内存设置-Xms256M -Xmx2048M -XX:MaxPermSize = 512M

正在处理ID 25118,请稍候... 调试器连接成功。 服务器编译检测到 JVM版本是14.3-b01

使用线程局部对象分配。 具有8个螺纹的并行GC

堆配置:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize = 2147483648(2048.0MB)
   NewSize = 2686976(2.5625MB)
   MaxNewSize = 17592186044415 MB
   OldSize = 5439488(5.1875MB)
   NewRatio = 2
   SurvivorRatio = 8
   PermSize = 21757952(20.75MB)
   MaxPermSize = 536870912(512.0MB)

404006.016: [GC [PSYoungGen: 242756K->10659K(249408K)] 609285K->378416K(825536K), 0.0244300 secs] [Times: user=0.09 sys=0.00, real=0.03 secs]   
404126.211: [GC [PSYoungGen: 239715K->11421K(250624K)] 607472K->379300K(826752K), 0.0314540 secs] [Times: user=0.08 sys=0.01, real=0.03 secs]   
404498.907: [GC [PSYoungGen: 241181K->15113K(250816K)] 609060K->383750K(826944K), 0.0567160 secs] [Times: user=0.11 sys=0.00, real=0.06 secs]   
404559.340: [GC [PSYoungGen: 81552K->9784K(250688K)] 450190K->378571K(826816K), 0.0255340 secs] [Times: user=0.08 sys=0.01, real=0.03 secs]   
404559.366: [Full GC (System) [PSYoungGen: 9784K->0K(250688K)] [PSOldGen: 368787K->225993K(576128K)] 378571K->225993K(826816K) [PSPermGen: 181648K->181648K(187968K)], 1.4180830 secs] [Times: user=1.42 sys=0.00, real=1.42 secs]   
404560.791: [GC [PSYoungGen: 1155K->64K(251072K)] 227148K->226057K(827200K), 0.0141730 secs] [Times: user=0.03 sys=0.02, real=0.01 secs]   
404560.806: [Full GC (System) [PSYoungGen: 64K->0K(251072K)] [PSOldGen: 225993K->202050K(576128K)] 226057K->202050K(827200K) [PSPermGen: 181648K->178996K(185216K)], 1.5066450 secs] [Times: user=1.50 sys=0.00, real=1.51 secs]   
404562.329: [GC [PSYoungGen: 1351K->272K(252032K)] 203401K->202322K(828160K), 0.0129750 secs] [Times: user=0.03 sys=0.01, real=0.01 secs]   
404562.342: [Full GC (System) [PSYoungGen: 272K->0K(252032K)] [PSOldGen: 202050K->202125K(576128K)] 202322K->202125K(828160K) [PSPermGen: 178996K->178996K(184512K)], 1.3184310 secs] [Times: user=1.32 sys=0.00, real=1.32 secs]   
404563.674: [GC [PSYoungGen: 1146K->128K(253312K)] 203271K->202253K(829440K), 0.0106520 secs] [Times: user=0.02 sys=0.01, real=0.01 secs]   
404563.685: [Full GC (System) [PSYoungGen: 128K->0K(253312K)] [PSOldGen: 202125K->202126K(576128K)] 202253K->202126K(829440K) [PSPermGen: 178997K->178997K(184000K)], 1.3197180 secs] [Times: user=1.32 sys=0.00, real=1.32 secs]   
404565.025: [GC [PSYoungGen: 1146K->64K(254976K)] 203272K->202190K(831104K), 0.0152030 secs] [Times: user=0.03 sys=0.01, real=0.01 secs]   
404565.041: [Full GC (System) [PSYoungGen: 64K->0K(254976K)] [PSOldGen: 202126K->202126K(576128K)] 202190K->202126K(831104K) [PSPermGen: 178997K->178997K(183296K)], 1.3072740 secs] [Times: user=1.31 sys=0.00, real=1.31 secs]   
404566.355: [GC [PSYoungGen: 1151K->160K(255360K)] 203278K->202286K(831488K), 0.0107640 secs] [Times: user=0.02 sys=0.02, real=0.01 secs]

1 个答案:

答案 0 :(得分:3)

PermGen正在填补:[PSPermGen:178997K-> 178997K(183296K)]

这是包含有关加载到JVM中的类的信息的空间,您可能需要添加-XX:+ TraceClassLoading -XX:+ TraceClassUnloading以查看为什么它变得如此之大,尽管您也可以增加PermGen的大小通过指定-XX:MaxPermSize = 512M。设置为512M并不罕见。