[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can userdate have references to lua objects?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 12 May 2003 16:32:39 -0300
> Memory expands uncontrollably, and I cannot get at the objects which are
> occupying memory. So it "might as well be a memory leak". :)
Of course you can. You only have to traverse the weak table. So it may
look like a duck, but it does not quack ;-)
> This means that tables in Lua can only grow without ever shrinking back.
They shrink, but only when they have enough "movement". For instance, in
your program, if you add a new element to the table (e.g., "t.x = 1") it
will shrink.
> A memory leak is where allocated memory(2) is not freed although it is
> never used again.
This is a funny definition. If I do "a = {}" and never use "a" again, I
have a memory leak... So memory leaks are non-computable.
-- Roberto