Greetings -
I’m using this function found on these forums to monitor memory:
function checkMemory()
collectgarbage( “collect” )
local memUsage_str = string.format( “MEMORY = %.3f KB”, collectgarbage( “count” ) )
print( memUsage_str, "TEXTURE = "…(system.getInfo(“textureMemoryUsed”) / (1024 * 1024) ) )
end
timer.performWithDelay( 1000, checkMemory, 0 )
When I start a scene (level1), the ‘Memory’ reads out to be about 450KBs - then when I go to a different scene (menu) and go back to the same level1 scene - the ‘Memory’ reads out to be 500KBs. It seems to increase by about 50KBs each time I revisit the ‘level1’ scene - even if I’m not doing any actions on the scene and immediately go back to menu then revisit. I really been cautious to cancel timers, remove and set objects to nil, use local variables, standard garbage collection stuff as seen in tutorials.
Is this increase in Memory a definite memory leak or I’m misinterpreting the function. The ‘Texture Memory’ does not increase. It runs smooth (60 fps) no matter how many times I go back to the level1 scene.
It’s caused me to stop my project until I can find an answer! The memory seems so minimal that I don’t know whether it’s a normal increase or will cause issues later.