@anderoth,
Thanks for the suggestion!
@TonoFilth,
Here are a few tips about finding memory leaks in general. The first thing you should do is make sure you have a memory leak in the first place. It can be difficult to tell if an increase in memory is a leak or just an innocent memory allocation. In order for it to be a leak, the memory must increase reproducibly. An easy way to think of it is to picture your app as a series of events. Naturally, there are events that should “undo” eachother in a memory standpoint. A common one is transitioning between scenes or going from the game scene to the main menu scene. The first few times the event occurs the memory will increase due to allocation but if you go back and forth a few times the memory should remain constant. If there is a leak, you should see a linear increase even after say 5 repetitions.
So now you have found a memory leak between the main menu and scene A. This is where profiler can help you the most. All you would need to do is call diffsnapshot() at some point during the transition from main menu to scene A. This means you can put it when scene A loads or when scene A unloads. Now, with mode 4 running you repeat the steps illustrated above and after a few repetitions a steady state emerges. Mode 4 will tell you the exact tables that are increasing from snapshot to snapshot so it should help you narrow down the problem.
Finding and fixing leaks is a difficult process and sometimes you need to ask yourself: How long will my program even be running? Obviously if you are making a web server you cant have even a single byte of leaking but for a game that the user plays for 20 minutes it might not be much of an issue for a small leak.
Regards,
M.Y. Developers [import]uid: 55057 topic_id: 34969 reply_id: 139094[/import]