Iphone Simulator-分配过多的内存,与设备相比运行缓慢 [英] Iphone Simulator - Allocates way too much memory and runs slow compared to device

查看:67
本文介绍了Iphone Simulator-分配过多的内存,与设备相比运行缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到很多关于模拟器运行缓慢的帖子,但是我的问题有所不同.

I've seen plenty of posts about the simulator running slow, but my problem is different.

我使用仪器运行了我的应用程序,发现在设备中,该应用程序在运行时会占用大约8mb的实时内存.在模拟器中,实时内存约为50MB,我不知道为什么会这样.

I ran my app with instruments and saw that in the device, the app uses about 8mb of live memory when the app is running. In the simulator the live memory is about 50MB, and I have no idea why this is.

这会导致模拟器滞后,我需要它平稳运行,以便我可以拍摄我的应用程序的漂亮屏幕截图.

This causes the simulator to lag and I need it to run smooth so i can take a nice screen capture video of my app.

有什么想法吗?

推荐答案

在OpenGL ES 1.1/2.0管道中,有许多步骤是在模拟器上运行时在软件中完成的(因为Mac GPU是纯OpenGL)但在设备上运行时硬件加速(因此它在设备上实际运行得更快).

There are a number of steps in the OpenGL ES 1.1/2.0 pipeline that are done in software when running on the simulator (as the Mac GPUs are plain OpenGL) but are hardware accelerated when running on the device (hence it actually running faster on the device).

从文档中:

重要提示:模拟器中OpenGL ES的渲染性能没有 与实际设备上OpenGL ES的性能有关. 模拟器提供了优化的软件光栅化程序,它可以 Macintosh的矢量处理功能的优势 电脑.因此,您的OpenGL ES代码可能会在以下环境中运行得更快或更慢 iOS模拟器(取决于您的计算机和绘图内容) 比实际设备上的要高.始终剖析和优化您的绘图 在真实设备上编写代码,并且永远不要认为模拟器会反映出 真实表现.

Important: 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.

这肯定可以解释速度差异,也可以解释在模拟器中运行时占用的额外内存.

This definitely explains the speed discrepancy, might also explain the extra memory taken up when running in the simulator.

这篇关于Iphone Simulator-分配过多的内存,与设备相比运行缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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