How to FInd Where memory leaks are

Discussion in 'iPhone/iPad Programming' started by Duke Leto, Jul 16, 2008.

  1. macrumors regular

    Joined:
    Mar 17, 2008
    #1
    In anther thread, it seems that people know which lines of code leak. How is it possible to determine where exactly the leak is. I am using Instruments, but it only tells me that I am leaking an Array somewhere.
     
  2. macrumors 65816

    dgdosen

    Joined:
    Dec 13, 2003
    Location:
    Seattle
    #2
    Debug memory leaks (one way) is to run your app using "Run/Start with Performance Tool/Object Allocations"

    If you see allocations go up but not come back down .... You may have a leak...
     
  3. macrumors member

    Joined:
    Jul 12, 2008
    Location:
    Fairfax, VA
    #3
    In Instruments, hover the mouse over the Array (or whatever object) that is leaking. You'll see a ">" icon appear next to it. Click on that to drill down. Eventually it will lead you to the exact line in your code that is leaking.

    It's *very* useful!

    Tom
     

Share This Page