CFNetwork / NSURLConnection泄漏 [英] CFNetwork / NSURLConnection leak

查看:1076
本文介绍了CFNetwork / NSURLConnection泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设备上运行仪器时,我会在CFNetwork中间歇性地发生严重3.5 KB的内存泄漏,负责框架为HostLookup_Master :: HostLookup ....

Running instruments on the device, I intermittently incur a memory leak of exactly 3.5 KB in CFNetwork, the responsible frame being "HostLookup_Master::HostLookup...."

我已经阅读了这个问题的一些问题,并单独尝试以下来修复泄漏:

I have read a number of questions re this issue and have separately tried the following to fix the leak:


  1. 包括以下内容in applicationDidFinishLaunching:

  1. Included the following in applicationDidFinishLaunching:

NSURLCache * sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
[sharedCache release];

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]; [NSURLCache setSharedURLCache:sharedCache]; [sharedCache release];

在url中指定不从本地缓存加载

Specified in the urlrequest not to load from the local cache.

上面没有一个工作。我的类实例化连接不泄漏,因为它的实例被释放时,数据已被下载。我已通过确认类的生命对象是使用Instruments验证这一点。

None of the above worked. My class that instantiates the connections does not leak as its instances are released when data has been downloaded. I have verified this by confirming the the living objects of the class is 0 using Instruments.

任何解决这个漏洞的建议都将非常感谢。

Any advice on addressing this leak would be greatly appreciated.

推荐答案

似乎苹果可能意识到与CFNetwork使用相关的3.5k泄漏,可能是已报告为错误

It seems that apple might be aware of the 3.5k leak related to CFNetwork usage and may have been reported as a bug already.

这篇关于CFNetwork / NSURLConnection泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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