Gabe Gabe - 6 days ago 5
Objective-C Question

Understanding Instruments in Xcode, testing for leaks

I just started using Instruments, a nice little tool for testing memory allocations/ leaks and all that great stuff. But I'm pretty confused at how it works... Ive looked for tutorials explaining how to work with it, but no tutorials explained what to do with it.

I'll try to explain this: I have it set up to whenever I run my Xcode app, Instruments tracks everything. But the stuff that instruments record makes no sense to me.

There was one leak discovered, and after that it started leaking bytes. It says the leaked object is _NSCFString and some other stuff like that. Here is a screenshot

enter image description here

My question is, how do I interpret this? If there is a tutorial out there that explain this, please leave as an answer, or explain it to me.

Answer

The best way to learn how to use Instruments is to watch the iOS Development Essential/Advanced/Foundation videos as well as the WWDC session videos on the topic.

You can find a list at Apple's Development Video Access which will require an iOS Developer Account and are usually hosted through iTunes.

iPhone Foundation Development Videos:

  • Session 916 - Getting Started with Instruments

WWDC 2009:

  • Session 414 - iPhone Performance Optimization with Instruments

WWDC 2010:

  • Session 304 - What's New in Instruments
  • Session 306 - Automating User Interface Testing with Instruments
  • Session 309 - Advanced Performance Analysis with Instruments
  • Session 311 - Advanced Memory Analysis with Instruments

WWDC 2011:

  • Session 310 - What's New In Instruments
  • Session 312 - iOS Performance and Power Optimization with Instruments

WWDC 2012:

  • Session 409 - Learning Instruments

WWDC 2014:

  • Session 418 - Improving Your App with Instruments

WWDC 2015:

  • Session 412 - Profiling in Depth

WWDC 2016:

  • Session 411 - System Trace in Depth
  • Session 418 - Using Time Profiler in Instruments
Comments