即使老一代未填满,仍会持续进行 Full GC
每隔几天我们就会看到连续的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
堆配置:
最小堆空闲比率 = 40
最大堆空闲比率 = 70
最大堆大小 = 2147483648 (2048.0MB)
新大小 = 2686976 (2.5625MB)
最大新大小 = 17592186044415 MB
旧大小 = 5439488 (5.1875MB)
新比率 = 2
幸存者比率 = 8
永久大小 = 21757952 (20.75MB)
最大永久大小 = 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]
Every few days we see continuous Full GC (more than 1000 FullGC's) and then the application comes to normal...the verbose GC log is as below .. when it is doing Full GC, the old generation is not filled up.. but what is prompting this Full Gc??
Environment/Settings
JDK 1.6
Memory Settings -Xms256M -Xmx2048M -XX:MaxPermSize=512M
Attaching to process ID 25118, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 14.3-b01
using thread-local object allocation.
Parallel GC with 8 thread(s)
Heap Configuration:
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PermGen 正在填满: [PSPermGen: 178997K->178997K(183296K)]
这是包含加载到 JVM 的类信息的空间,您可能需要添加 -XX:+TraceClassLoading -XX:+TraceClassUnloading 来查看为什么它变得这么大,尽管您也可以通过指定 -XX:MaxPermSize=512M 来增加 PermGen 的大小。 512M 的设置并不罕见。
The PermGen is filling up: [PSPermGen: 178997K->178997K(183296K)]
That's the space that contains information about classes that are loaded into the JVM, you may want to add -XX:+TraceClassLoading -XX:+TraceClassUnloading to see why it's getting so big although you can also increase the size of the PermGen by specifying -XX:MaxPermSize=512M. A setting of 512M is not uncommon.