lua-users home
lua-l archive

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

    My embedded lua5 app has gotten fairly large now ( about 4K lines ).  I
began a force garbage collection every 30 frames or so by calling
lua_setgcthreshold with 0 and that worked really well for quite a while.
Just recently i noticed that in about an hour of use the app goes from using
15MB to over 30MB of memory usage.  The only dynamic memory allocation that
occurs in my app during the main loop stems from lua, so i'm fairly certain
that this is some little lua objects that are refusing to be GC'd.

    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.  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.  =)