lua-users home
lua-l archive

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

Stephen Kellett wrote:
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.

Of course, but what Rob meant is that Lua isn't known to leak memory (because of some bug) by itself.

Improper use of a language or a library can happily eat memory without releasing it, that's not language's fault, but programmer's. Well, the same applies to C, of course, but it is even easier to forget to release memory!

As you point out, garbage collection is insidious, somehow, as programmers indeed might believe it automagically release all resources, so might become sloppier than a C programmer...

I had to hunt down in a very large Java program all calls to a DB wrapper, because lot of programmers just forgot to add a call to a close method (most of the time lacking a finally clause), resulting in a shortage of database handlers...
And I guess there are a number of file handles hanging around...

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --