I\'m nearly finished with my app and I\'m using Instruments to optimize performance before I submit to the app store. I noticed that whenever I execute a particular action (
A couple of thoughts:
In the heap shot, don't forget to show the extended detail (⌘+E or select "Extended Detail" from the "View" menu) in the rightmost panel of Instruments.
When viewing extended detail, it will show you a stack trace, and you can double-click on your method name there (which will be in black rather than light gray) and you'll be taken to the line that generated the allocation (which obviously isn't necessary the root problem, but it will show you where the object was originally allocated, which is a place to start).
Having said that, I generally focus on the standard Allocations tool first. I'll option-drag in the allocations instrument timeline at the top to highlight allocations within this time window of execution, I'll then select "Call Tree", and to focus on just my code, I'll check the "Invert Call Tree" and "Hide System Libraries" boxes:
For me, I find that's a more efficient way of identifying my allocations that took place within that window of time, without sifting through system allocations.
Do not forget to run your code through the static analyzer in Xcode (shift+⌘+B or choose "Analyze" on the "Product" menu). You should get a clean bill of health there before you even start running your app through Instruments.