GC minimization importance

How important is it to minimize garbage collection in a realtime game on JDK1.5.0/WinXP ?

I have a relatively simple asteroids clone that I wrote in 1999 on JDK1.2 / Win98 that I’m rewriting for an example web release. Back then I ended up retrofitting it so that it would resuse every object that it could to help cut down on garbage collection pauses (it tripled the time between pauses, which was good enough for me then). When I run it now (original code compiled and run on 1.5) on WinXP 3.0GHz P4, I don’t get any gc pauses. (NT back then didn’t have any pauses either). Has garbage collection / Java improved that much that I don’t need to worry about this anymore? I’m asking now before I write too much more because while retrofitting for object reuse isn’t too much of a problem, I wouldn’t like to do it. Most of what I’m writing now is doing about %70 object reuse and I’d definitely be happier if I didn’t have to worry about it too much.

Derek

Basically - just create small objects as much as you feel like and then if it turns out to be a problem, start looking at pooling.

Large objects or objects which are expensive to construct (often the same thing) are usually best pooled.

If you have a look at my games Alien Flux and Super Dudester, can you spot the difference? Flux used a lot of pooling - all the bullets, lasers, and particles are pooled. Super Dudester uses no pooling at all. Flux runs a little better on very low end systems, but the effort is simply not worth it now.

Cas :slight_smile: