View Full Version : Memory Leak Help
Feb 13, 2012, 09:27 PM
I am at the final stage of my non-ARC iPhone app and I am having trouble with memory leaks. Instruments only points out 3 memory leaks when I run the app on my device. However, when I run and Analyze in Xcode, I get like 50 potential leaks. Which one should I trust? Are there any alternate(non-apple) methods for detecting leaks?
Feb 14, 2012, 01:25 AM
You look at each instance and decide if the analyzer is telling the truth. It's pretty good at identifying leaks. I've seen a few cases, like blocks, can confuse the the situation.
Feb 14, 2012, 02:25 AM
I think you should check all of them.. Leaks can cause an application to crash hard and be rejected by Apple in the end. And it's just not fun when you're using the application that it will crash eventually.
Check each instance, what are you retaining, when not, when should you release, autorelease, set to nil and so on.
Feb 14, 2012, 07:46 AM
Look at all the ones that show up in Analyze but only fix them if they make sense. I've found the Leaks instrument to be more accurate.
Feb 14, 2012, 06:18 PM
Thanks For Your Responses!!
I am having some trouble: When using my device, stack traces only have system libraries, none of my methods. When I double click on a leak, there is no code. It gives the error:"No Source". This does not appear when I use the simulator. Also, How can I hide system libraries? The box is grayed out.
Just in Case This Helps: I am using Bugsense (http://www.bugsense.com/) and "strip debug symbols during copy is set to NO"
Feb 15, 2012, 07:05 PM
You may be interested in 'Diagnosing Memory Problems' at new site NSScreencast.com