lua-users home
lua-l archive

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


> 1) Why is Lua's own GC not able to keep memory down on its own,
>    even when its count hits the threshold?

It seems that there is a subtle bug in the GC speed. Do you allocate
other things with each userdata? Specifically, does each userdata has an
own metatable or fenv?

Did you try to change the GC parameters? Specifically, try something
like this:

  collectgarbage("setpause", 170)

("170" can be anything between 120 and 190; 200 is current default.) 


> 4) Why do the first manual calls to GC not free up all the
>    memory? Is that really just memory fragmentation? If so, why
>    does it take so long to stabilize, and why does it stabilize at
>    all?

A manual call to GC performs only one cycle. To finalize *and* collect
all userdata you need two GC cycles, so you need to call GC twice.

-- Roberto