GC Tuning: NewRatio

When it comes to garbage collection tuning the first setting to be adjusted is often the heap size. This is not always the optimal choice though. If only because a bigger heap size will tend to mechanically lengthen the duration of GC pauses.

Instead of increasing the heap size it can pay to increase the size of the young generation relative to the old. That's where the NewRatio setting (i.e  ratio of the old gen space to the young gen space) comes in.

The screenshots below illustrate how GC activity differs when an application producing short-lived objects at a high frequency runs with NewRatio=2 and when it runs with NewRatio=1. Collections in the old gen disappear provided there's enough size in the young space to accomodate all the short lived objects.


NewRatio =2 (default setting on Windows 64 bits).





NewRatio =1


No comments:

Post a Comment