How to FInd Where memory leaks are

Discussion in 'iOS Programming' started by Duke Leto, Jul 16, 2008.

  1. macrumors regular

    Mar 17, 2008
    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


    Dec 13, 2003
    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

    Jul 12, 2008
    Fairfax, VA
    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!


Share This Page