[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Memory leak in Lua 5.0
- From: "Jeff Petkau" <jeffp@...>
- Date: Mon, 30 Sep 2002 11:07:47 -0700
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