1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Memory Leak Help

Discussion in 'iPhone/iPad Programming' started by ahan.tm, Feb 13, 2012.

  1. ahan.tm, Feb 13, 2012
    Last edited: Feb 13, 2012

    macrumors regular


    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?

  2. macrumors 68000

    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.
  3. macrumors 65816


    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.
  4. macrumors 6502

    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.
  5. macrumors regular


    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 and "strip debug symbols during copy is set to NO"

  6. macrumors 68000

    You may be interested in 'Diagnosing Memory Problems' at new site NSScreencast.com

Share This Page