加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 17:59:35 所属栏目:百科 来源:网络整理
导读:我在我的Macbook Air上运行我的应用程序和我的 Iphone 6s,下面的图像是我浏览应用程序中的所有UI后的内存使用情况.在这两个场景中,我执行了类似的任务和持续时间.为什么模拟器的内存使用量比实际设备高得多.即使设备内存使用情况似乎合理,我是否应该担心?
我在我的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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读