lua-users home
lua-l archive

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


If you've got significant data accessed from Lua via stub userdata objects
-- i.e., objects just containing pointers to the real data -- it is
definitely a good idea to give the GC a little more help. In our case, it's
huge bitmaps that create the issue.

Under Lua 5.1 our solution is to run the GC forward a bit as we allocate
these. How much to run it forward was determined essentially empirically
(haphazardly?) to balance between memory consumption and GC time.

Under Lua 5.0, we built up a count of the number of bytes allocated and
forced a full GC when that number crossed a threshold.

Mark