iOS允许应用程序使用多少内存? [英] How much memory does iOS allow apps to use?

查看:501
本文介绍了iOS允许应用程序使用多少内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个使用很多相当大的图像文件的应用程序.我注意到当它们全部加载到我的iPhone 3G(128 mb ram)上时,它崩溃了,但是当我在第三代iPod(256 mb ram)上对其进行测试时却没有崩溃.因此,我假设每个应用程序都必须允许使用一定百分比?我的应用程序包含约30张图像,每张图像加载约440k,因此13.2mb.我认为那不会太多.它们需要快速地交换进出,因此从内存中释放不使用的对象似乎不是一个好主意...

I am making an app that uses a lot of fairly big image files. I notice it crashes when they all get loaded on my iPhone 3G (128 mb ram), but not when I test it on a 3rd gen iPod (256 mb ram). So I assume there must be some percentage that is allowed for each app to use? My app has about 30 images at about 440k each loaded so 13.2mb. I didn't think that would be too much. They need to be swapped in and out pretty quickly, so releasing the ones not in use from memory doesn't seem like a good idea...

该应用程序根据手机倾斜的方式交换图像.它是来自3D场景的30张图像,因此当您移动它时,它会改变视角.它需要尽可能平滑.

The app swaps images based on the way the phone is being tilted. It's 30 images from a 3D scene, so when you move it, it changes the perspective. It needs to be as smooth as possible.

推荐答案

答案是:尽可能多,直到操作系统发出抱怨为止.

The answer is: as much as you want, until the OS complains.

没有绝对的内存限制,因为它完全取决于手机的内存,操作系统及其相关服务占用的时间以及一个月的时间(只是在开玩笑,但您会明白的) ).

There is no such thing as an absolute memory limit, since it wholly depends on the phone's memory, how much the OS and its related services are taking up, and the time of the month (just kidding, but you get the idea).

您应该按比例缩小这些大图像文件以适合内存,或者甚至更多,考虑到屏幕太小并且在任何特定时间只能查看这么多图像,请不要一次全部加载它们.

You should be scaling down these large image files to fit into memory, or even more so, not loading them all at once considering the screen is so small and only so much can be viewed at any one particular time.

这篇关于iOS允许应用程序使用多少内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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