Wen/Clumsy waxy glutinous (Jane book author)
Original link: http://www.jianshu.com/p/0837331875f0
As an iOS development siege lion, almost half of our development time is spent in managing memory when Apple does not have an arc (automatic memory management mechanism). Later, Apple was very human out of arc, although to a large extent, to help our developers save energy and time. But we are in the process of development, For a variety of reasons, there is still a memory leak. Memory leaks are a serious problem. Here's a quick introduction to how to use the leaks in the XCODE7 instruments to detect that our program has no memory leaks and locates the memory leak code. (Analysis of memory leaks can not isolate all memory leaks, and some memory leaks are at runtime, when the user operation is generated)
The first step: Open the XCODE7 instruments
Or:
Click on the above, build successfully jump out of the instruments tool, select the leaks option
After selecting the interface such as:
After we got here, we finished our preparatory work, and started the formal test!
1. Select Xcode to run the program (COMMAND + R) first
2. Select Xcode and press the shortcut key (Command + control + i) to run, and leaks is running.
3. Because leaks is dynamic monitoring, so we need to manually operate the app, while operating, while observing the changes in the leaks, when the Red Fork, the memory leak is monitored, click the second in the upper right corner, for pause detection (also can continue to detect, when more than one pause, one processing more than one).:
4. The following is the positioning modification, at this time to select a red pillar of the leaks, there is a "field" in the box, open, select the call Tree
Display as Interface
5. The following is the most critical step, in the bottom right corner of the interface there are a number of checkboxes, select Invert call Tree and hide System Libraries, (red Circle Range) is shown as follows:
Even if it's basically done here, the memory leak code section is shown here, so now it's one step ahead: Locate!
6. Select one of the displayed bars and double-click to automatically jump to the memory leak code,
7. Where the memory leaks are found, then we can modify them
IOS memory leak troubleshooting and processing