PDA

View Full Version : How to FInd Where memory leaks are




Duke Leto
Jul 16, 2008, 09:54 AM
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.



louden
Jul 16, 2008, 10:29 AM
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...

SwampThingTom
Jul 16, 2008, 03:06 PM
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.

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