Game "stutters" -- is this the garbage c

What I’m using: Java2D, 1.4.2 on OS X

Okay, I spent a lot of time writing a class that parses an XML file that stores the animation data for my sprites. It basically extracts a bunch of integers that represent the frames, delays, etc. and stores them in an int array in the sprite class. The problem is that while animating, frequently my whole game slows down to a crawl and sprites jump around sporadically as a bunch of frames are missed. This slowness will eventually pass and then everything is fine again until the next time it happens. This didn’t happen at all when my animation data was hard-coded in the sprite class. I tried profiling it but I didn’t notice anything very unusual.

Uh, my question was, does this sound like an issue with too much garbage being generated?

FYI: Apple has java dev. forums, you will probably
probably get more specific answers there, but here are some
general things you can check out.

You could run it with -verbose:gc and see if your pauses
correspond to gc.

You might want to check that you’re not generating
new images on each frame - this is a typical cause
of exsessive GC.

Also, you can run your game on other platforms, see
if you get the same behavior.

Thanks,
Dmitri
Java2D Team

And, of course, profile your app. The latest version of Net Beans apprantly has a profiler plug in.

-Chris

Thanks for the replies. I tested on Windows, and no, there are no problems there >:(

I profiled it with -Xrunhprof, but nothing really looks out of the ordinary. I don’t really know what to look for, though. I played around with the threads and managed to make the stuttering a little less noticeable, but it’s definitely still there. At this point I’m not sure whether to just pass this off as another problem with Java2D on OS X, or to continue to look for a solution…