建议使用仪器泄漏的新手 [英] Advice using leaks in instruments for noobs

查看:67
本文介绍了建议使用仪器泄漏的新手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是iPhone开发的新手.我是使用工具"中的泄漏"第一次运行我的应用程序的.它向我显示了大约20个泄漏,最小泄漏为32个字节,其中一个泄漏为1KB.我遵循了内存管理准则,(i(认为i)了解如何以及何时使用发布,而不是在添加到自动发布池中时使用发布,对于每个副本,保留,初始化都应该有发布,等等.) .我认为我不了解仪器泄漏的结果. 负责的图书馆"和负责的框架"是什么意思.因为有些类和方法我从未直接使用过.它还显示了我在connectionDidFinishLoading方法以及错误处理程序方法中实现的NSURLConnection对象.因此,从技术上讲,他们没有办法泄漏.是否有任何调试仪器中内存泄漏的好教程,或者您可以给我有关泄漏的其他建议.预先感谢.

Hello I am pretty new to iphone development. I have run my app for the first time using the "Leaks" from "Instruments". It shows me several leaks around 20 the smallest is 32 bytes and there is one with 1KB. I have followed the memory management guidelines, (i (think i) understand how and when to use release, not to use it when adding to autorelease pools, for every copy, retain, init there should be a release,... etc). I don't think I understand the output of the Leaks in instruments. What does "Responsible library" and "Responsible frame" mean. Because there are some classes and methods i never used directly. It also shows NSURLConnection objects which I have realeased in the connectionDidFinishLoading method and also in the error handler method. So tehnically there is no way for them to leak. Are there any good tutorials for debugging memory leaks in instruments or other advice you can give me regarding leaks. Thanks in advance.

这是最大的2次泄漏.


Leaked Object   #   Address Size    Responsible Library Responsible Frame
Malloc 1.00 KB      0x4827400   1024    CFNetwork   std::vector >*, std::allocator >*> >::reserve(unsigned long)

// i have no idea what this is.

Leaked Object   #   Address Size    Responsible Library Responsible Frame
Malloc 128 Bytes    5       640 UIKit   UIImagePickerLoadPhotoLibraryIfNecessary
// so this means UIImagePicker is leaking memory?

我第一次漏水


Leaked Object   #   Address Size    Responsible Library Responsible Frame
Malloc 128 Bytes        0x442dfd0   128 UIKit   UIKeyboardInputManagerClassForInputMode

我什么都不懂.

我感到很奇怪,即使是几乎没有任何代码但没有添加代码的空应用程序,仅视图和文本字段也会泄漏内存.

And I find it very strange that even an almost empty app with no code added, just a view and a textfield also leaks memory.

推荐答案

以下是一些我发现的东西.如果还有其他人,请添加它们.

Here are some i found. If there are others then please add them.

http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments http://www.mobileorchard.com/find -iphone-memory-leaks-a-leaks-tool-tutorial

这篇关于建议使用仪器泄漏的新手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆