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

标签 ios iphone xcode memory simulator

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

相关文章:

iphone - 在代码 xcode iOS objective c 中禁用 DLogs

ios - XCode 8.2 无法将接口(interface)生成器 IBOutlet 连接到 swift 文件

ios - awakeFromNib vs Outlets - 当我们调用 awakeFromNib 时设置 outlets 和 segues

ios - Xamarin 无法识别已安装的字体

ios - HTML5 和 MP4 与 M2TS 容器

iphone - 无法打开可执行文件 - xcode

iphone - PVR Texture Compression Tiling(暴露边缘上下文)

iphone - 如何在横向模式下转换 Navigation Bar 和 Navigation Controller

ios - 调用此方法时应用程序状态是什么?

XCode:在每次应用程序运行时重复 "Generating dSYM file"步骤