简体   繁体   English

ARC下仪器内存泄漏

[英]Instrument memory leak under ARC

I've rebuild my app, I found that it would use a lot of memory. 我重建了我的应用程序,发现它将占用大量内存。 Before, it keeps under 20M memories. 以前,它的内存不足2000万。 Now it's up to 70M memories. 现在最多可存储70M。

When I use Instrument to analysis memory leaks. 当我使用Instrument分析内存泄漏时。 I got this 我懂了

在此处输入图片说明

When I click it for details. 单击详细信息时。 It says the memory leaks in main.m 它说main.m中的内存泄漏

在此处输入图片说明

Why does it show 100% leak? 为什么显示100%泄漏?

How can I fix this problem? 我该如何解决这个问题? Or please some advice about find out my leak problem and the way to fix it. 或者,请提供一些有关发现我的泄漏问题以及解决方法的建议。 Thanks 谢谢

It shows a 100% memory leak because main () is where your application starts. 它显示100%的内存泄漏,因为main()是应用程序启动的地方。 100% of the memory leaks in your application are in your application. 应用程序中100%的内存泄漏在应用程序中。 Kind of obvious really, isn't it? 确实很明显,不是吗?

You need to find a more specific place. 您需要找到一个更具体的地方。 Maybe it's time to learn the difference between weak and strong references as well. 也许是时候学习弱引用和强引用之间的区别了。 (See Quentin's comment). (请参阅Quentin的评论)。

Does your memory use increase over time, or does it stop at 70 MB? 您的内存使用量会随着时间增加还是在70 MB处停止? What actions increase memory use? 哪些操作会增加内存使用量?

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

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