I’ve bookmarked some great techniques here (thanks, Matt!) for tracking down memory leaks, but on a high level, what kinds of culprits should one look for?
For instance is .new
anything without later setting it to nil or re-using it a no-no?
(I’ve tried to make every image and samplePlayer in my game be a declared variable that gets re-used in case that helps. It seemed to.)
Or are memory leaks always SDK bugs? I’ve seen some suggest that, in which case I’d stop trying to chase the issue down and focus instead on a) using less RAM in general and b) making sure progress gets preserved through crashes. (Both of which should be pretty simple.)
My memory usage bounces up and down wildly but it averages out to a slooooooow leak that eventually causes a crash. It’s very unpredictable (my game is complex and randomized) and can take several hours, so most players might not see it… but I’d love NOBODY to see it!
(Is a slow leak a side effect of using the malloc map at all? My long-run automated stress-testing is on the Simulator rather than the device. It’s harder to test slow leaks on the device.)
Thanks in advance!