lua-users home
lua-l archive

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




2015-05-15 13:34 GMT+08:00 Dirk Laurie <dirk.laurie@gmail.com>:

Could you expand on this sideswipe?

- Does it leak memory?
- Does it have too great an overhead?
- Is it not configurable enough?
- Any other way in which it is not so great?

No, the implementation of GC in Lua (and LuaJIT) are accurate and the incremental GC is very good.
I do not find any memory leak. But it's overhead is a bit big. It use single-link to implement gc object list
and gray list, the traversal of the lists in sweep phase and mark phase is not cache-friendly. In some
of our applications, sweeplist and reallymarkobject functions have relative big cache miss rate.

You can reference to Mike Pall's GC design for LuaJIT 3.0 for more information:
http://wiki.luajit.org/New-Garbage-Collector

Regards,
Zenk Ju