lua-users home
lua-l archive

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

Sorry, no insights into this leak specifically, but it
does bring up a possible suggestion for Lua 5.2 (or 6.0,
or whatever) - the ability to programatically walk or otherwise
instrument the not-dead object set in a similar manner to how the
GC does.  One of my largest time-sinks in debugging Lua programs
has been trying to discover:

(1) what objects are not being GC'd when I think their lifetime
'should' be over, and
(2) 'who' is holding the unexpected references keeping those
objects alive.

I investigate (1) by adding destructor methods to suspected classes
(p.s. __dtor on tables is useful for this reason even if the other
uses for it are considered unnecessary :)) which print something
like 'blah blah is dying now!' and note the conspicuous absence of
such output, or maintain a refcount-by-object-type in the ctor/dtor
pair which I can monitor for imbalance.  I haven't devised a great
way to debug (2) except by inspection.