[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Speaking of 5.0 (was RE: Memory leak in Lua 5.0)
- From: "Brownsword, Andrew" <ABrownswor@...>
- Date: Mon, 30 Sep 2002 13:12:01 -0700
Where is the link to download 5.0? Is it still alpha?
-----Original Message-----
From: Jeff Petkau [mailto:jeffp@adrenium.com]
Sent: Monday, September 30, 2002 11:08 AM
To: Multiple recipients of list
Subject: Memory leak in Lua 5.0
I noticed a problem in Lua 5.0's garbage collection.
If a coroutine has a reference to a table, and the
table has a reference back to the coroutine, they
will not be garbage collected even when they become
unreachable.
Is this a known bug?
Here's a simple demo.
----
function test()
local t = {}
local f = function()
print(t)
end
t.f = coroutine.create(f)
end
collectgarbage()
print(gcinfo())
for i=1,100000 do test() end
collectgarbage()
print(gcinfo())
---
--Jeff Petkau