Memory leak ..ish

I have a menu screen and a game screen using director to flick between the two.

I have commented most of my code to a bare bones (which just loads a few buttons ) to try and understand what is happenning with the memory.

The first few times I go to the game screen and then return to the menu I see a slight increase in memory usage each time I get back to the menu screen.

After the 3rd or 4th time I go back to the menu the memory usage stays at the increased level but doesn’t get any higher.

I was wondering if anyone has any ideas as to why this may be happening as it’s really bugging me. [import]uid: 51494 topic_id: 21509 reply_id: 321509[/import]

Hi garethward,

I was wondering if you ever found the problem. I have the same issue. I am not using director though. When I hit my restart button everything is cleared and the game restarts but with a tiny increase in memory-mine only does this once and never increases again no matter how many times I restart. I am trying to force myself to let it go as it doesn’t seem to be casuing any major issues but like you it is bugging me. [import]uid: 39370 topic_id: 21509 reply_id: 85805[/import]

I never did find the reason. I don’t think it’s necessarily director related because I made a similar project with the new storyboard api and experienced similar (although not identical) behaviour. Like you I don’t think it’s a major problem but not knowing niggles me. [import]uid: 51494 topic_id: 21509 reply_id: 85842[/import]

–Deleted-- [import]uid: 73951 topic_id: 21509 reply_id: 92944[/import]

I’m going to bump this. I’m having the same issue. The increase is only slight, but I want to know why it is.

D [import]uid: 60144 topic_id: 21509 reply_id: 106671[/import]

guys, could I ask, from a newbie’s pov, how do you keep an eye on memory status when testing my app ? [import]uid: 97524 topic_id: 21509 reply_id: 108664[/import]

Still experiencing this issue, haven’t had too much time to investigate it though…

@dax: I know there’s a post around here somewhere. Do a search on memory management. Go to Google and type in: ansca memory management (good way to find anything corona related, type in “ansca” then what you want to know into Google)

Anyway, there are a few in the forums and some in the Ansca blog. I do some simple memory monitoring with this function, then I call it at either regular intervals (during gameplay) or at the opening of each scene…

[lua] – Debug: Memory Monitor
monitorMem = function()
collectgarbage(“collect”)
print( "\n\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nMemUsage: " … collectgarbage(“count”) )
local textMem = system.getInfo( “textureMemoryUsed” ) / 1000000
print( "TexMem: " … textMem )
print( “=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n” )
textMem = nil
end[/lua] [import]uid: 60144 topic_id: 21509 reply_id: 108672[/import]