iOS使用Xcode7的Instruments检测解决iOS内存泄露


中文可以参考

苹果官网


To look for memory leaks
1.Launch Instruments.
2.When the profiling template selection dialog appears, click Leaks.
3.Choose your device and app from the target device and process lists.
4.Click Choose to create a trace document.
5.Click the Record button (image: ../Art/inline_record_button_2x.png) in the toolbar or press Command-R to begin recording.
6.Use your app normally.
7.Watch the Leaks instrument in the timeline pane for leaks. A leak appears as a red bar.
8.Click the Leaks instrument in the timeline pane to display leak-related information in the detail pane.
9.Choose Call Tree from the detail type list in the navigation bar of the detail pane. This displays a list of method calls related to any detected leaks.
10.Press Command-2 to show the display settings area of the inspector pane.
11.Under the Call Tree display settings, select Invert Call Tree and Hide System Libraries.
  This shows you the most recent method calls first. It also helps narrow down the list of method calls to ones made by your app. Method calls made by your app are colored black and preceded by a user code icon (image: ../Art/inline_usercode_icon_2x.png).
12.In the call tree, select a method call you want to investigate.
13.Press Command-3 to display a stack trace for the selected method call in the extended detail area of the inspector.
14.Double-click the method call in the stack trace to display its code in Instruments.
15.Click the Xcode button (image: ../Art/inline_xcode_2x.png) at the top of the detail pane to open the code in Xcode for review and editing.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值