I'm using
local monitorMem = function()
collectgarbage()
print( "\nMemUsage: " .. collectgarbage("count") )
end |
stage:addEventListener(Event.ENTER_FRAME, monitorMem)
To track memory leaks. I'm spawning a box2d sprite, removing it's physics fixture and body, then removing the sprite from the scene. But my memory usage slowly ticks up and up as each sprite is added and removed.
What are some other things that could cause this?
I think I'm removing the timers and event listeners correctly...
Thanks
Comments
I think I have found the problem - each sprite had a timer attached. Adding timer:stop(); seems to have fixed things.
Thanks again.
Likes: atilim