gpt4 book ai didi

ios - 模拟器和设备之间的应用程序内存使用差异

转载 作者:可可西里 更新时间:2023-11-01 03:45:19 25 4
gpt4 key购买 nike

我在我的 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

关于ios - 模拟器和设备之间的应用程序内存使用差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39071510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com