iOS设备和iPhone模拟器之间的内存组织差异 [英] Difference of memory organization between iOS device and iPhone simulator

查看:144
本文介绍了iOS设备和iPhone模拟器之间的内存组织差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Xcode 4.3.3和iPhone 5.1模拟器来开发应用程序.

I'm trying to develop an app using Xcode 4.3.3 with iPhone 5.1 simulator.

当我在模拟器上运行此应用程序时,我没有任何警告,并且运行良好.但是,当我尝试在iOS设备上执行此操作时,收到了一条警告消息,它是收到的内存警告.当应用开始在屏幕上显示图像时,我收到了此警告消息.我正在使用 SDWebImage 项目,该项目可在github中显示图像.我认为此问题已解决内存组织在iOS设备和模拟器之间有何不同.我看过这个问题如何构建iOS设备和模拟器的实际用途是否有所不同?,了解iOS设备和模拟器的构建应用程序如何有所不同.但是,我对内存组织的发现并不令我满意.你们知道为什么会这样吗?

When i run this app on simulator, i got no warnings and it's working very well. But,when i try to make this work on iOS device,i got an warning message which is Received memory warnings. I got this warning message while the app starts to display images on the screen. I'm using SDWebImage project which is available in github to display images.I think this problem is releated to how memory organization differs from iOS device to simulator. I have looked this question How does building for iOS device and simulator actually differ? to see how the building app for iOS Device and Simulator differs. But,what i found about memory organization didn't satisfy me. Do you guys have any idea why this is happening ?

另一个问题:在内存管理的上下文中,应用程序是否有任何限制?我的意思是,例如,假设分配了5MB内存,我会收到任何指向此问题的消息吗?

Another question : Is there any limitation for an application in the context of memory management? What i mean is, for example let's say 5MB memory is allocated ,will i get any messages which points to this issue ?

谢谢.

推荐答案

除非您亲自创建警告(使用模拟内存警告"选项),否则您将永远不会在模拟器中收到内存警告.您可以访问Mac的整个内存,包括虚拟内存.您最好不要用移动应用程序耗尽...

You will never get memory warnings in the simulator unless you create them yourself (with the "Simulate Memory Warning" option). You have access to the entire memory of the Mac, including virtual memory. You had better not run out with a mobile app...

如果您在设备上看到内存警告,则表明您使用了过多的内存.确定问题所在的最佳工具是工具,尤其是分配工具.这将向您显示占用最多内存的内容以及应该关注的地方.大多数内存警告是由于泄漏或保留循环引起的.

If you're seeing memory warnings on device, it means you're using too much memory. The best tool for determining where you're having trouble is Instruments and specifically the Allocations instrument. This will show you what is taking the most memory and where you should focus. Most memory warnings are due to a leak or retain loop.

这篇关于iOS设备和iPhone模拟器之间的内存组织差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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