[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Garbage Collection bottleneck
- From: "Brian Weed" <brianweed@...>
- Date: Wed, 21 Jun 2006 17:46:25 -0400
On 6/21/06, Joshua Jensen <firstname.lastname@example.org> wrote:
Brian Weed wrote:
> We are using Lua 5.02 in our game engine, and although we had no
> problems on previous projects, the garbage collection now seems to be
> a bottleneck (noticable pause in the main loop when the GC executes).
> The problem stems from my creation of some temporary global variables
> inside each tick of the main loop.
> Although it seems that the incremental GC of Lua v5.1 would probably
> solve this problem, upgrading is a last resort...I am looking for
> solutions that don't involve upgrading.
You could look into luarc, a reference counted version of Lua. It
doesn't have the 5.0.3 fixes in it, but I do believe it is current to
5.0.2 (although a failing memory never helps). Its webpage is at
http://luaplus.org/tiki-index.php?page=luarc. You want the build out of
The reference counting seems stable and there is really no performance
comparison between the standard mark-sweep collector (which still exists
in luarc to handle table cycles) and the reference counting's ability to
destroy objects immediately. The reference counting Lua has shipped a
number of Xbox and Xbox 360 console titles, although they've only
shipped through LuaPlus (which is where the reference counting was
born). I believe all LuaPlus reference counting changes are merged into
Turns out I was using Lua 5.0 and not 5.0.2...
Using luarc does fix my problem in a small sample test app, but unfortunately it also crashes in my production code. Before I try to track down that problem, I will try upgrading to Lua