Friday, April 8, 2011

How to avoid Garbage Collection

Overview

The unpredictability of Garbage Collection can be a serious issue for some applications. You can play with the tuning parameters, but the simplest approach is to create less garbage.

Low garbage application

For low latency trading system, minimising GC time is important. The extreme case is avoid GCs all together.

If you reduce the garbage produced and increase your Eden size you can reduce your GCs to once per day (as an over night task) In the case of this application the Full GC triggered at 5 am every morning takes 1-2 seconds (during the overnight maintenance window)

It should be possible to extend the period between GCs to once a week.

No comments:

Post a Comment