0

re Instruments 'Memory Leak' profiling, do other tools give any more info re finding root cause of a leak?

My issue I'm stuck on is finding the root cause (as opposed to where the leaky object was created, which Instruments tells me). For an example where I'm stuck see What is the source of the leaky object for this code? Simplistically it seems I'm not releasing an object somewhere, but this object is bundled within a parent, which is within a parent etc etc so I'm having a hard time trying to track down where I went wrong.

So my question is, beyond Instruments (and the profiling using 'Memory Leaks', which tells you the location of creation of the leaky object, but not the root cause), are there any other tools I could run that could give me any more info than Instruments re tracking down the root cause point?

EDIT 1 - Note my application will BUILD & ANALYZE without any issues.

4
  • You could try build using "Analyze". I have found that that helps me find a lot of problem points that are difficult to track down by the time they are running in "Leaks"
    – Dancreek
    May 25, 2011 at 23:12
  • thanks - but should have said that before I even started running Profile my app was BUILD & ANALYZE'ing without any issues...
    – Greg
    May 25, 2011 at 23:18
  • possible duplicate of any good tutorials on finding root cause of memory leaks after Intruments has identified the location of creation of the leaky object? Please edit your earlier question rather than reposting.
    – jscs
    May 25, 2011 at 23:33
  • good point - I'd forgotten I'd modified this previous question - I've modified the previous question to match the responses I got - this makes more sense - this question then is specific up front re what I'm after
    – Greg
    May 26, 2011 at 1:01

1 Answer 1

1

I'm fairly new to reading the instrumentation displays, but the way I found a couple of leaks in my app was to watch the allocated object counts in instruments and then repeatedly perform some simple UI function. I'd see 2 or 3 object counts constantly increasing over a period of time as I tapped the screen over and over.

Looking at the classes I found that during development I'd added some properties and forgotten to nil then in the dealloc code. Once I added those statements the leaks disappeared.

The interesting point is that these didn't show up in the leaks display or the static analysers. At least not that I recognised.

1
  • thanks Derek - that's a good example of tips I'm fishing for - unfortunately for me I have one point in my app where it loads data and does a number of things at once, so it probably wouldn't help me for my specific problem area
    – Greg
    May 26, 2011 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.