Hello and welcome

to Intellicore’s blog where we will give you info on relevant topics in relation to IT. We see the blog as a joint effort and would love to hear what you would like us to feature (there’s no point in us writing a blog that’s not of interest and we’d hate to bore you…)

Xcode Instruments Series: Part 2 - Detect memory leaks


So you are coming towards the end of the development cycle for your latest iOS application. The fun part of developing new features for your application is over and now you are into the drudgery of fixing leaks, optimizing code and squashing bugs.

In this post, I am going to show you how to detect memory leaks in your application.



1. First, hold down the left-mouse button on the 'Run' icon in the top-left and choose 'Profiling' when it comes up.






2. When Instruments loads your application, you will see the Allocations track start to fill in.
To detect the leaks in your project, click on the Leaks track and then watch the Leak Status category which will detect leaks after the current time-out value.




3. Once the leak detection process has occurred, you will see the list of objects that are currently leaking. The get more information on a particular leak, select the object in the list and then click the 'Extended Detail' button at the bottom of the instruments screen.




4. Once you have clicked this button, you will see the stack trace list on the right side of the Instruments window. Look through the stack and locate any code highlighted that contains a string consisting of your applications name and path.




5. Double click on a leak in your application and Instruments will return you to the exact line in your application where the leak is happening.










_________________________________________________________________________

0 comments :

Post a Comment