Hey All,
Applying a simple technique I use with c++/c#, I see no memory getting collected. Can anyone tell me why this is happening for such a simple example? Before alloc, mem says 87k. I then alloc 1000 rect and the mem jumps to 224k. Then dealloc the rects (in several different ways) and the last mem call still says 224k. (If I copy/paste the code and do the same thing twice I lose the same amount again)
Thanks,
Ted
[lua]
local sayMem = function()
collectgarbage()
print( "MemUsage: "…collectgarbage(“count”) )
–local textMem = system.getInfo( “textureMemoryUsed” ) / 1000000
–print( "TexMem: " … textMem )
end
sayMem()
local group = display.newGroup()
for i=1,1000 do
group:insert(display.newRect(0,0,i,i))
end
sayMem()
– unneeded but tried anyway
–for i=group.numChildren,1,-1 do
– local r = group[i]
– r:removeSelf()
– --group:remove®
– r = nil
–end
group:removeSelf()
group = nil
sayMem()
[/lua]
[import]uid: 73649 topic_id: 36988 reply_id: 336988[/import]