From: Paul Brannan Date: 2006-01-27T00:55:34+09:00 Subject: Re: Minimizing memory allocations On Wed, Jan 25, 2006 at 12:45:41AM +0900, Timothy Goddard wrote: > I don't know anything about Lua, but Ruby is unlikely to see and speed > benefits from garbage collecting every frame unless you're deep in > swap. Ruby uses a "mark and sweep" garbage collection scheme, which I > believe means that garbage collecting time is mostly proportional to > the number of current, referenced objects, not the amount of junk left > behind. The marking time is proportional to the number of referenced objects, and the sweeping time is proportional to the number of objects that get swept. In general, the longer the time between sweeps, the more objects need to be swept. Invoking the GC every frame probably won't improve average frame rate, but it may help decrease the variance of the time it takes to process each frame (so you get more consistent performance). Paul