A quick memory usage/leak question

I have a basic menu which my app loads straight into. All it has is a few buttons. The first time the menu loads the memory used is 187 kb. If I load a level of the game (which runs sprites, physics and all kind of other stuff) the memory jumps to 415kb which I would expect however when I return to the menu the memory used is now 347 kb.

If I go back to the level again I see 415kb, back to the menu 347kb, and I can repeat this over and over without seeing any change in memory usage.

So my question really is around the initial jump from 187kb on load to the 347kb it stays at forever after that. Do I have a memory problem or is this normal?? I am using storyboard for the transitions between scenes BTW. [import]uid: 148866 topic_id: 36143 reply_id: 336143[/import]

Hi @NoobChoobGames,
The memory “jump” you describe sounds fairly normal. You would have reason to be worried if your memory usage continued to climb as you navigated from scene to scene, or between two scenes back and forth. If you’re watching your memory “return” to a relatively stable value after many scene changes, going back to the menu, etc. then I would say your code is fine. Just watch for a continual climb… that’s a clear indication of a leak.

Brent [import]uid: 200026 topic_id: 36143 reply_id: 143622[/import]

Thanks for the reply Brent I’m glad to see it is normal. Memory usage is very stable between scene changes after the initial spike. [import]uid: 148866 topic_id: 36143 reply_id: 143633[/import]

Hi @NoobChoobGames,
The memory “jump” you describe sounds fairly normal. You would have reason to be worried if your memory usage continued to climb as you navigated from scene to scene, or between two scenes back and forth. If you’re watching your memory “return” to a relatively stable value after many scene changes, going back to the menu, etc. then I would say your code is fine. Just watch for a continual climb… that’s a clear indication of a leak.

Brent [import]uid: 200026 topic_id: 36143 reply_id: 143622[/import]

Thanks for the reply Brent I’m glad to see it is normal. Memory usage is very stable between scene changes after the initial spike. [import]uid: 148866 topic_id: 36143 reply_id: 143633[/import]

Hi @NoobChoobGames,
The memory “jump” you describe sounds fairly normal. You would have reason to be worried if your memory usage continued to climb as you navigated from scene to scene, or between two scenes back and forth. If you’re watching your memory “return” to a relatively stable value after many scene changes, going back to the menu, etc. then I would say your code is fine. Just watch for a continual climb… that’s a clear indication of a leak.

Brent [import]uid: 200026 topic_id: 36143 reply_id: 143622[/import]

Thanks for the reply Brent I’m glad to see it is normal. Memory usage is very stable between scene changes after the initial spike. [import]uid: 148866 topic_id: 36143 reply_id: 143633[/import]

Hi @NoobChoobGames,
The memory “jump” you describe sounds fairly normal. You would have reason to be worried if your memory usage continued to climb as you navigated from scene to scene, or between two scenes back and forth. If you’re watching your memory “return” to a relatively stable value after many scene changes, going back to the menu, etc. then I would say your code is fine. Just watch for a continual climb… that’s a clear indication of a leak.

Brent [import]uid: 200026 topic_id: 36143 reply_id: 143622[/import]

Thanks for the reply Brent I’m glad to see it is normal. Memory usage is very stable between scene changes after the initial spike. [import]uid: 148866 topic_id: 36143 reply_id: 143633[/import]