lua-users home
lua-l archive

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


Peter Steiner wrote:

thanks for your answer, but my question was concerning a different point:

i would like to know if the garbage collector of Lua is stable in the sense of memory usage over very long, and highly active, interpreter run times (i am talking in the magnitude of months) - from experience i know that many otherwise very mature interpreters suffer in this regard.

I can't answer that exact question, but I can add some points for
consideration based on my experience with porting Lua to a deeply
embedded system...

1. The quality of your malloc/realloc/free library is the first level
   of defence against memory leaks.

2. The Lua garbage collector is tunable in terms of how frequently it
   runs the incremental collector, and how often a full GC sweep
   is done.

3. The Lua VM has undergone a lot of use and more importantly has
   been really well designed and coded. Please refer to the History
   of Lua (Paper submitted to HOPL 2007) and the Lua Reference Manual
   and source code.

the popular reference applications like games etc. don't exercise long execution time, but my intended domain is in highly available server applications, where this is a given requirement.

i will stress test this behavior anyways, but i would like to know if others have experience in such applications of Lua...

There's nothing like stress testing as long as your simulation is
testing what you think you are testing :-)

That being said, a brief look through the mailing list archive shows
that most "memory leaks" are due to programmer error, not bugs in
the VM itself.

I hope this helps...

Ralph