How To Debug Memory Leaks with XCode and Instruments Tutorial 边读边记

How To Debug Memory Leaks with XCode and Instruments Tutorial

大神还有一些advise,赶紧记录一下,不禁长叹一声,早就该看如此好文了。相见恨晚啊

Here’s the advice I generally give to developers when you hit an EXC_BAD_ACCESS error:

  1. Set the NSZombieEnabled argument in your executable options, which sometimes helps narrow down the cause
  2. Run with Apple Instruments such as Leaks to look for memory issues
  3. Set a breakpoint in your code and step through until you narrow down where it’s crashing
  4. Tried and true “comment out code till it works” then backtrack from there :]
夜已深,先睡了。
现在是第二天,奇怪,我的Instruments看到的情况跟教程里面提到的不一致,尤其是,没有显示那个函数,不知道为什么?暂时把这个问题挂起吧,我的版本是Xcode把嫩是 Version 4.4.1 (4F1003),我觉得不是版本的原因。

Let’s try it out. Go to Run\Run with Performance Tool\Leaks, and select a few rows in the table view. Also scroll up and down the table view from the top of the table to the bottom of the table. After bait of experimentation, you should start seeing some leaks popping up in the Leaks tab, which show up as blue bars.

Click the stop button, then go to the toolbar in the middle and click it to change from “Leaked Blocks” to “Call Tree”. In the panel in the lower left, click “Invert Call Tree”, and “Hide System Libraries”. You’ll see that it found two different methods in the code with memory leaks, as you can see below:

我没有看到blue bars,后面也没看到到这this two  methods
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值