简体   繁体   English

如何摆脱 1 级和 2 级 memory 警告?

[英]How to get rid of level 1 and level 2 memory warnings?

I'm developing an iPhone project,in my application whenever i click on my custom top uinavigationbar right and left button i'm getting level 1 and level 2 memory warnings and my app is getting crash in lower memory devices like iPod touch.我正在开发一个 iPhone 项目,在我的应用程序中,每当我单击自定义顶部导航栏左右按钮时,我都会收到 1 级和 2 级 memory 警告,并且我的应用程序在 iPod touch 等较低的 memory 设备中崩溃。 I don't Know what is the problem.我不知道是什么问题。 Any help is appreciated, Thanks in advance.任何帮助表示赞赏,在此先感谢。

Most likely reason is that you have one or possibly more memory leaks.最可能的原因是您有一个或多个 memory 泄漏。 Use Instruments with the Leaks tool to find them and then fix them.使用带有 Leaks 工具的 Instruments 找到它们,然后修复它们。

Another reason is that you're using memory correctly, but simply too much of it.另一个原因是您正确使用了 memory,但使用的太多了。 You will then need to find a way to reduce the amount of memory used, for example by storing data you don't need at the moment in files.然后,您需要找到一种方法来减少 memory 的使用量,例如将您目前不需要的数据存储在文件中。

This is a good tutorial to let one know about memory leaks and management. 是一个很好的教程,让人们了解 memory 泄漏和管理。

One way to check is Run->Run with performance tool-> Allocations一种检查方法是运行-> 使用性能工具运行-> 分配

Here you can find where actually you are getting your memory allocated more.在这里,您可以找到实际分配更多 memory 的位置。

Accordingly you can manage.因此,您可以管理。

Memory leaks may also may be reason check Memory Leaks too.... Memory 泄漏也可能是原因检查 Memory 也泄漏....

Hope it helps......希望能帮助到你......

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

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