0

I am using xcode 3.2 and I have leaks in my app but how can I find the line in my code which is leaking?? In earlier version of xcode I just used to double click on the object in the instrument which used to show the xcode with pointing the line with the leak. But in the 3.2 version I am not able to do that. Please anyone tell me how to find the line where memory is leaking?

Any help would be appreciated.

Ideveloper
  • 1,467
  • 4
  • 23
  • 44
  • Instruments in XCode 3.2 has changed - but only for the better. It should be even *easier* to drill down to the suspect code. What behaviour are you seeing when you trying to "double click on the object"? – philsquared Aug 10 '10 at 10:35
  • its show me assembly code which i dont understand. – Ideveloper Aug 10 '10 at 10:56
  • Are you using a debug build? It should show you the whole stack - with your code at some points and framework code at others. You should be able to see the source for your code. If you're using a release build you'll probably get strange symbol names for the methods themselves, but if you double click on them you should still get code. Below the stack listing you'll see a slider. Slide it more to the left (but not all the way) to filter out most of the framework code. – philsquared Aug 10 '10 at 11:24
  • btw, I'm just finishing off a new blog post covering some techniques to help you avoid getting the leaks in the first place. Watch for it here in the next day or so: www.levelofindirection.com – philsquared Aug 10 '10 at 11:33

2 Answers2

0

You're probably working on 10.6, then you can use the extremely cool Build & Analyze feature (shift+cmd+a or in the menu Build->Build & Analyze).

cutsoy
  • 10,127
  • 4
  • 40
  • 57
  • 1
    This is a good suggestion, but doesn't answer the posters question. Personally I find the LLVM analyser misses a lot - so it's best to use *both* tools. – philsquared Aug 10 '10 at 10:57
  • I have used it already. Analyser is not showing me the leaks but instruments is showing me leaks. – Ideveloper Aug 10 '10 at 11:08
0

In addition to my comments on your question, you might also find this helpeful (it was top link on the "Related" list on the right hand side of this page):

Instruments Leaks - Not showing my source code

Community
  • 1
  • 1
philsquared
  • 22,403
  • 12
  • 69
  • 98