lua-users home
lua-l archive

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


My experience tells me that Lua does not leak when used correctly.

Indeed, many people that use GC'd languages think that memory leaks are impossible, that garbage collection is a panacea.

The reality is that memory leaks still happen, but rather than the explicit leaks that you get with C/C++/Pascal applications you get implicit leaks (*) which happen when you forget to release a reference to an object you no longer need. These unwanted objects loiter in the memory space, using memory and referencing other objects that could also be freed.

We've made an attempt at this with Lua Memory Validator (Windows only, so not relevant to the original poster) but sadly Lua doesn't provide all the info we need to do this properly (like we have done for Java, JavaScript, Python and Ruby). If you are interested, you can find out more here:

http://www.softwareverify.com/lua/memory/index.html

It appears at present that LMV gives better data with Lua 5.1 than Lua 5.0.

Stephen
(*) also known as loiterers in the Java community - use a Google search to find out more about these, they apply to Python, Ruby, Lua, JavaScript, etc