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
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.
Choose “Xcode” in the top left of the screen. Expand “Open Developer Tool,” and select “Instruments” Now choose “Leaks,” and make sure you have chosen your target app and device at the top (“Choose a profiling template for…”):
From the toolbar of XCode, choose Product > Profile > Leaks to start a new instrument profile for tracking memory leaks.
Instrumenting AllocationsPress Command-I in Xcode, select Allocations from the list and press Choose. After a moment, you'll see the Allocations instrument. It should look familiar because it looks a lot like Time Profiler. Click the record button in the top-left corner to run the app.
Xcode's Memory Graph Debugger If you haven't used this yet, it's easy to access while developing. Tapping on the icon will pause your application and generate a graph of the objects with their references to other objects. If there's leaked memory detected, you will see purple icons on the left pane of Xcode.
The best way to learn how to use Instruments is to watch the iOS/macOS Development Essential/Advanced/Foundation videos as well as the WWDC session videos on the topic.
You can find a list at past WWDC Session Videos to watch. They do not require a developer account to access.
iPhone Foundation Development Videos:
WWDC 2009:
WWDC 2010:
WWDC 2011:
WWDC 2012:
WWDC 2014:
WWDC 2015:
WWDC 2016:
WWDC 2018:
WWDC 2019:
2020 Tech Talks:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With