[Gc] GC in "soft" real time

Jim Hourihan jimhourihan at gmail.com
Thu Aug 26 10:02:33 PDT 2010


We've been using the GC in our cross platform app for a few years now, and its been great. But in the process we've starting using it *too* much inside of a render loop (~60Hz at its fastest, usually 24). So collection is taking longer than .03 seconds for us on windows in particular. On mac and linux its still under the limit.

I had a thought about our particular use case which I'm not sure is directly applicable to the GC library itself or not.

Basically, we've observed that *all* of the memory allocated during the critical rendering loop can be immediately reclaimed. No object allocated during that time is retained.  The obvious solution is allocate from a pool (e.g. objc autorelease) and free it all on return from the rendering code. (I'm sure there is a term-of-art for this that I don't know.)

So my question is: is this something that makes sense to do in the context of the GC library (because of issues I don't know about) or should this type of thing be implemented outside of it.

A little bit of context: the GC is being used by our extension language which is making OpenGL calls. Its not being used for all memory management in the app.

Thanks for any help.

    -Jim


More information about the Gc mailing list