Hi Guys,
this code produces a significant memory leak for me. It loads 20 000 circles into a table and then removes them. The memory usage goes from 80kb to 3000 and then, instead of back to 80, to 600. Is this a bug or am I doing something wrong?
local points = {}
timer.performWithDelay(1000, function()
for i = 1, 20000 do
points[i] = display.newCircle(30,30, 4)
end
end)
timer.performWithDelay(4000, function()
for i = 1, #points do
display.remove(points[i])
points[i] = nil
end
end)
local monitorMem = function()
collectgarbage()
print( "MemUsage: " .. collectgarbage("count") )
local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000
print( "TexMem: " .. textMem )
end
Runtime:addEventListener( "enterFrame", monitorMem )
(Tried in the windows simulator in builds 726 and 730. The problem seems to exist when using images instead of circles as well.) [import]uid: 21937 topic_id: 20746 reply_id: 320746[/import]

