lua-users home
lua-l archive

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


Just a quick query to satisfy my curiosity about the new incremental
garbage collector: if I have a state with a significant amount of
collectable objects, does incrementally collecting with lua_gc("step")
guarantee that it will definitely be collected at some point?

The reason I ask is that the behaviour I'm seeing from the lua VM is
that the GCthreshold remains constant at some high value, even though
the garbage collector has been through several sweeps. If I call
lua_gc and make it do a full (non-incremental) collect, it manages to
clear up all of the collectable data. If I don't do a full collect,
the data is never collected. No combination of parameters to SETPACE,
SETINCMODE or STEP seems to make a difference.

I would guess that I'm just misusing the system, but all I'm doing is
starting the incremental collection at load time (GCRESTART), then
constantly calling SETPACE, SETINCMODE and then STEP (in that order)
once every tick.

Any pointers to my obvious mistake?

Ta
ChrisC