Skip to main content

Young Collections taking longer than Full ones

3 replies [Last post]
Joined: 2009-02-03

Hi all,

I have a high demanding application running under JDK 1.5.0_16, 64bits. The heap is set to 4G for the young and about 10G for the old generation. Survivor ratio is set to 8.
Low pauses are more important than throughput for this application, so I'm using the CMS collector. In normal load, young collectios occur each 2 minutes and their pauses range from 500 ms to 1.2 seconds, usally around 0.8 seconds. Full collections take place each hour or hour and a half, with pauses of about 400 ms (just seen a very rare exception of 7 seconds!)

Well, my question is, regardless of that 7 seconds pause exception, why I'm having YGC pauses longer than FGC ones?

These are the parameters to the JVM:
-Xloggc:/var/log/tomcat-5.5/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+DisableExplicitGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSCompactAtFullCollection -XX:+UseParNewGC -XX:MaxPermSize=256M -XX:PermSize=256M -XX:+UseConcMarkSweepGC -XX:MaxNewSize=4G -XX:NewSize=4G -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=10'

Many thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-01-07

> Well, my question is, regardless of that 7 seconds
> pause exception, why I'm having YGC pauses longer
> than FGC ones?
Do you mean by "pauses" the time the GC is active, or the time the application is actually halted?

If you talk about the time the app is halted, its because CMS does most of its work, while the app is running, whereas the parralell collector for the young generation pauses the app the whole time.

4GB for the young generation is quite a lot, I would reduce it if pauses are a problem (maybe to 1GB).

- Clemens

Joined: 2009-02-03

Those 7-8 second pauses in FGCs were happening lastly more often.
Finally, I chose the CMS incremental mode with IncrementalPacing, and following your advice reduced the YG size to 2G (not to 1G because that will exhaust too fast during very high load peaks).

Now I'm getting pauses between 200ms and 400-500 ms for YGC and between 500ms and 700ms for the FGCs stop-the-world phases. I think it's pretty good for a high load application with 14GB RAM! Thanks for your help.

Here there are the JVM parameters, they could be useful for someone:

-Xms14G -Xmx14G -Xloggc:/var/log/tomcat-5.5/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+DisableExplicitGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSCompactAtFullCollection -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:+UseParNewGC -XX:MaxPermSize=256M -XX:PermSize=256M -XX:+UseConcMarkSweepGC -XX:MaxNewSize=2G -XX:NewSize=2G -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=10

Joined: 2009-02-03

On the other hand, if I use CMSIncrementalMode, the YGC pauses are slightly reduced, they become more uniform and always sub-second times. At the same time, the FGC times increase considerably to around 1 second or more.

The machine has two Dual Core AMD Opteron CPUs at 2.4GHz, so 4 cores available.