lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 21 Jun 2006 13:49:01 -0400
"Brian Weed" <brianweed@gmail.com> 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.
> [...]

Have you tried increasing the GC threshold? If you do so, you will let
Lua have a bigger amount of "waste" objects in memory without being
collected. (Details: http://www.lua.org/manual/5.0/manual.html#2.9).

This way you can control how and when the GC gets done.

Cheers,

-- 
Adrian Perez
"Experience is what you get when you don't get what you want"
                                           -- (Dan Stanford)