Finding Memory Leaks in Your App
Use the Leaks instrument of the Instruments analysis tool to find objects in your app that are no longer referenced and reachable.
Open the Leaks template.
Choose your app from the Choose Target pop-up menu.
Click the Record button.
Exercise your app to execute code, and click Stop when leaks are displayed.
Click any leaked object identified in the Detail pane.
Within the Extended Detail pane, double-click an instruction from your code.
In the Detail pane, click the Xcode icon to open that code in Xcode.
Click the Leaks instrument in the Instruments pane to display leaks in the Detail pane. The Leaks graph shows you the number of leaks and total leaked bytes.
The screenshot shows the Allocations and Leaks instruments recording the CalcLeaks app, with a
malloc leak selected in the Detail pane and the stack trace for that leak in the Extended Detail pane.