lua-users home
lua-l archive

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


The following code seems to make the garbage collector unable to
finish the gc cycle. Can anyone give me some insights into this
problem.

--------------------------------------------------------------------
collectgarbage()
collectgarbage("stop")

print("free memory: ", collectgarbage("count"));

local step = 0

while not collectgarbage("step") do
        step = step + 1
        print("step: ", step, "free memory", collectgarbage("count"))
        local x = {}
        for i = 1, 1000 do
                x[i] = {}
        end
end
---------------------------------------------------------------------