内存泄漏工具告诉我零泄漏,但内存占用不断增加 [英] Memory leak tool tells me zero leaks but memory footprint keeps rising

查看:135
本文介绍了内存泄漏工具告诉我零泄漏,但内存占用不断增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为SDK 3.2中的应用程序运行一些内存分析,我使用'Leak'分析器来查找我的所有内存泄漏并将所有内存插入。这是一个scrollView navigationController应用程序,其中有瓷砖,你点击一个瓷砖,进入瓷砖的新视图等等,我可以深入多层次,并一直回到顶部,'泄漏'剖析器说一切很酷。



但是,如果我在'ObjectAlloc'分析器中观察内存占用,随着我的深入(这似乎是合理的),内存占用量会上升和下降,但是我退出了视图,内存占用量并没有像我预期的那样下降。



我知道这是一个模糊的应用程序描述,但我不能确切地发布了数十亿行代码:)另外应该注意我正在使用coreData来存储图像数据,因此随着更多节点的选择,数据库的大小越来越大,如果/何时从内存中释放,则不知道。 / p>

给出了什么?

解决方案

有关核心数据内存管理的信息是很好的信息和技术上亚瑟Kalliokosk的答案我是一个很好的答案:韭菜和对象分配的区别。我在这里的特殊问题与模拟器中一个按钮上的setBackgroundImage明显已知的错误有关,它会创建一个内存泄漏,因为它不释放永远释放UIImage的内存。


I'm running through some memory profiling for my application in SDK 3.2 and I used the 'Leak' profiler to find all my memory leaks and I plugged all of them up. This is a scrollView navigationController application where there are tiles and you click a tile which goes to a new view of tiles and so on, I can go many levels deep and come all the way back to the top and the 'Leak' profiler says everything is cool.

However, if I watch the memory footprint in the 'ObjectAlloc' profiler the memory footprint goes up and up as I go deeper (which seems reasonable) but as I back out of the views the memory footprint doesn't go down as I'd expect.

I know this is a vague description of the app but I can't exactly post a gillion lines of code :) Also it should be noted I'm using coreData to store image data as I go so the database is growing in size as more nodes are chosen, dunno if/when that is released from memory.

What gives?

解决方案

The information on core data memory management is good info and technically the answer by Arthur Kalliokoski is a good answer re: the difference between a leek and object allocation. My particular problem here is related to an apparently known bug with setBackgroundImage on a button in the simulator, it creates a memory 'leak' in that it doesn't release ever release the memory for the UIImage.

这篇关于内存泄漏工具告诉我零泄漏,但内存占用不断增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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