ios – 模拟器和设备之间的App内存使用差异

前端之家收集整理的这篇文章主要介绍了ios – 模拟器和设备之间的App内存使用差异前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的Macbook Air上运行我的应用程序和我的 Iphone 6s,下面的图像是我浏览应用程序中的所有UI后的内存使用情况.在这两个场景中,我执行了类似的任务和持续时间.为什么模拟器的内存使用量比实际设备高得多.即使设备内存使用情况似乎合理,我是否应该担心?

enter image description here

解决方法

好问题.感谢您提出这样的问题.

Apple Documentation says

Simulator is a useful tool,but it should not be the only way you test an app. Because the simulator is an app running on a Mac,it has access to the computer’s resources,including the cpu,memory,and network connection. All of these resources are likely to be faster than those found on a mobile device. As a result,the simulator is not an accurate test of an app’s performance,memory usage,and networking speed. For this same reason,always test the performance of your app’s user interface on a device. In Simulator,your app’s user interface may appear to run both faster and smoother than on a device

Xcode’s iOS simulator reports 2GB RAM for iPhone 6S,4GB for iPad Pro

Xcode’s iOS simulator shows 2GB of RAM for iPhone 6s and 6s Plus,4GB for iPad Pro

最后讨论的解决方案是

Why the iPhone Simulator is Awesome

我从jbat100的答案中找到了确切的解决方案.

Rendering performance of OpenGL ES in Simulator has no relation to the performance of OpenGL ES on an actual device. Simulator provides an optimized software rasterizer that takes advantage of the vector processing capabilities of your Macintosh computer. As a result,your OpenGL ES code may run faster or slower in iOS simulator (depending on your computer and what you are drawing) than on an actual device. Always profile and optimize your drawing code on a real device and never assume that Simulator reflects real-world performance.

Iphone Simulator – Allocates way too much memory and runs slow compared to device

猜你在找的Xcode相关文章