lua-users home
lua-l archive

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




>     Does anyone have any good tips on how to track down the actual lua
code
that's causing this?  I guess i should also consider that i'm
fragmenting
memory so much that it forces the heap growth i'm seeing.  


You may be creating Lua objects without realizing it (but GC should
collect these):
http://lua-users.org/wiki/OptimisingGarbageCollection

By allocating and collecting lots of objects that you may not have meant
to create, you may be fragmenting the memory as you suggest. You just
have to keep track of references wrt to objects hanging around that you
thought should have been deleted.

Weak tables can cause loops where you might not expect them:
http://lua-users.org/wiki/GarbageCollectingWeakTables

> I'll be changing
my lua source to have callbacks for memory allocation which i can easily
overload with my own... be a nice thing to include in a future release
by
the way.  =)

Do you mean per object type? You can overload all of Lua's allocation by
just changing lmem.c

--nick