lua-users home
lua-l archive

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


Hello,

Has anyone implemented an allocation profiler for Lua?  Ideally, one which
has a stack trace for the most common allocations, or the largest
allocations.  I definitely need information on 'hidden' allocations like
closures and coroutine stacks, etc.  The idea here is obviously to reduce
garbage generation, and to measure what's taking up how much memory.

All I know is gcinfo() tells me Lua's using something like 20 megs of RAM
(that's after a few collectgarbage() cycles...), and I have no idea why
it's using so much.  Probably something tied to C code is leaking.

Are there any pointers to doing this?  There's no debug hook for
allocations; could I add one?  By modifying lmem.c?

Thanks
-Andy