G1收集器没有进行完整的GC [英] G1 Collector not doing full GC

查看:128
本文介绍了G1收集器没有进行完整的GC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

切换到java 1.7.0_80一周后,观察到这种行为

S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
0 32M 0 32M 512M 128M 9.5G 7.7G 640M 475M 26487 157min 0 0min 157min



没有完整的GC,分配给老一代的大空间以及年轻一代发生的太多集合。

通过JMX调用完整GC后



S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
0 32M 0 32M 5.2G 768M 4.8G 2.7G 640M 475M 26592 158.4min 1 0.1min 158min

GC时间减少了很多。

参数是

  -Xms10g 
-Xmx10g
-XX:PermSize = 640m
-XX:MaxPermSize = 640m
-XX :SurvivorRatio = 30
-XX:MaxTenuringThreshold = 15
-XX:+ UseG1GC
-XX:MaxGCPauseMillis = 100
-XX:InitiatingHeapOccupancyPercent = 80
-XX: G1HeapRegionSize = 32m
-XX:ParallelG CThreads = 16

可能是因为-XX:MaxGCPauseMillis = 100?



旧一代中的很多对象都在ehcache中,TimeToIdle为10分钟,但如果在到期后没有请求相同的对象或者缓存未满,ehcache不会清除对象。

解决方案

-Xmx10g -XX:InitiatingHeapOccupancyPercent = 80


我的高级算术技能告诉我,10GB的80%是8GB。

OU 7.7G

小于8。

因此不会启动并发循环。设置一个较低的IHOP或者不要明确设置,以便G1可以在运行时自动调整它。


For a week after switching to java 1.7.0_80, observed this behavior

S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT 0 32M 0 32M 512M 128M 9.5G 7.7G 640M 475M 26487 157min 0 0min 157min

No Full GC, large space allocated to old generation and too many collections happening in young generation.

After invoking full GC via JMX

S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT 0 32M 0 32M 5.2G 768M 4.8G 2.7G 640M 475M 26592 158.4min 1 0.1min 158min

And GC times reduced a lot.

Parameters are

-Xms10g
-Xmx10g
-XX:PermSize=640m
-XX:MaxPermSize=640m
-XX:SurvivorRatio=30
-XX:MaxTenuringThreshold=15
-XX:+UseG1GC
-XX:MaxGCPauseMillis=100
-XX:InitiatingHeapOccupancyPercent=80
-XX:G1HeapRegionSize=32m
-XX:ParallelGCThreads=16

Could it be because of -XX:MaxGCPauseMillis=100?

Lot of objects in old generation are held in ehcache with TimeToIdle of 10 mins but ehcache does not clean up objects if same objects is not requested after expiry or if cache is not full.

解决方案

-Xmx10g -XX:InitiatingHeapOccupancyPercent=80

My advanced arithmetic skills tell me that 80% of 10GB is 8GB.

OU 7.7G

That's less than 8.

Therefore no concurrent cycle will be initiated. Set a lower IHOP or don't set it explicitly so G1 can adjust it automatically at runtime.

这篇关于G1收集器没有进行完整的GC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆