简体   繁体   English

内存增加,没有释放内存

[英]Memory increase with no release memory

I search how find my problem. 我搜索如何找到我的问题。 In my application for iPad when i treat data i have an increase memory and never release that memory, i try instruments leaks memory but that not find memory leaks (i try with profile and analyze). 在我的iPad应用程序中,当我处理数据时,我具有增加的内存并且从不释放该内存,我尝试使用仪器泄漏内存,但找不到内存泄漏(我尝试使用配置文件并进行分析)。

So my question is they have an other instrument for find memory leaks or other methods? 因此,我的问题是他们还有其他工具来查找内存泄漏或其他方法吗?

Thanks in advance for your consideration. 预先感谢您的考虑。

PS : I don't post code cause that concerned a big part of my code but the part where memory increase is a part where i download from a FTP some zip files (based on SimpleFTPSample from Apple Doc) i unzip this files (with framework minizip) this zip files contains some images and XML files i parse this XML files (around 7200 XML files and 35 000 images files saved) i saved some information (issue of parsing) in data base and that its. PS:我不会发布代码,这引起了我代码的很大一部分,但是内存增加的部分是我从FTP下载一些zip文件(基于Apple Doc的SimpleFTPSample)的一部分,我解压缩了这些文件(使用框架) minizip)(该压缩文件包含一些图像和XML文件),我解析此XML文件(保存了大约7200个XML文件和35 000个图像文件),我在数据库及其中保存了一些信息(解析问题)。 If you need part of my code for help me ask me. 如果您需要我的部分代码来帮助我,请问我。

Make sure if you have Zombies turned off in Scheme:Diagnostics. 确保是否在Scheme:Diagnostics中关闭了僵尸。 With Zombies on no memory is ever deleted. 在“僵尸”上,不会删除任何内存。 Testing for memory leakage should always be done with Zombies off. 内存泄漏测试应始终在“僵尸”关闭的情况下进行。

This usually happens when you keep the objects in a datastructure (NSDictionary, NSArray, eg), even after you don't need them anymore. 当您将对象保留在数据结构(例如NSDictionary,NSArray)中时,通常会发生这种情况,即使您不再需要它们也是如此。 Check with Instruments' Allocations which objects are accumulated, and check in your code where you keep instances of those objects. 检查“仪器的分配”中累积了哪些对象,并在代码中检入保留这些对象实例的位置。

Another cause could be long-running threads. 另一个原因可能是线程长时间运行。 If the loading and parsing you mentioned are done in a single thread that takes a long time, then you may need to do @autoreleasepool in a loop somewhere to force temporary objects to be cleaned up regularly. 如果您提到的加载和解析是在花费很长时间的单个线程中完成的,那么您可能需要在某个地方的循环中执行@autoreleasepool以强制定期清理临时对象。

It might also be no problem at all. 可能也没有问题。 You say you load a lot of images. 您说您加载了很多图像。 Images are by default cached by iOS, and only released when necessary to clean up memory. 图像默认情况下由iOS缓存,并且仅在必要时才释放以清理内存。 If Instruments "Trace Highlights" shows a lot of memory usage, but "Allocations" doesn't, then this is likely the cause. 如果乐器的“跟踪高亮”显示很多内存使用情况,但“分配”没有,则可能是原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM