Hej,
I read a lot about this topic now, but am kinda confused by what is a memory leak and how to prevent it.
Whenever I test my app with a memory monitor like “RG Super Meter” or just a "collectgarbage() ,collectgarbage(“count”) " I see that, when I change a scene with the “slim director class”, the memory is increasing but hitting a peak, when I just change between two scenes .
I thought that every scene has its memory consumption and would go back to the amount of used memory, when I changed to the same scene again.
For example.
Screen A needs 200kb of memory.
Screen B needs 340kb of memory.
But when I go back to Screen A my memory just goes back to 300kb instead of 200kb.
Is this already a memory leak?
If yes, then I am not sure, what I am doing wrong.
I tried to make everything local, except of just a few globals, that I create in the main.lua.
I even collect all the transitions and timers and delete them manually like jon bebe suggested.
I use modules in the local way, like this :
local M = {}
local function name ()
local localGroup = display.newGroup()
[…]
return localGroup
end
M.name = name
return M
what else is there to do?
By the way, what is a good memory usage? What is the memory and videomemory limit of devices like
Iphone 3s, Iphone 4, Iphone 4s and Iphone5?
thanks for the help!
Cheers Philip