问题
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.
回答1:
-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.
来源:https://stackoverflow.com/questions/38555796/g1-collector-not-doing-full-gc