iOS 允许应用程序使用多少内存?

发布于 2024-10-02 08:43:56 字数 313 浏览 2 评论 0原文

我正在制作一个使用大量相当大的图像文件的应用程序。我注意到,当它们全部加载到我的 iPhone 3G(128 mb 内存)上时,它会崩溃,但当我在第三代 iPod(256 mb 内存)上测试时,它不会崩溃。所以我假设每个应用程序都必须有一定的百分比可以使用?我的应用程序有大约 30 张图像,每张图像大小约为 440k,加载后大小为 13.2mb。我认为这不会太多。它们需要很快地换入和换出,因此从内存中释放未使用的图像似乎不是一个好主意...

编辑:

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

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

EDIT:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七分※倦醒 2024-10-09 08:43:56

答案是:随心所欲,直到操作系统抱怨为止。

不存在绝对的内存限制,因为它完全取决于手机的内存、操作系统及其相关服务占用的数量以及每月的时间(开玩笑,但您明白了)。

您应该缩小这些大图像文件以适应内存,或者更重要的是,考虑到屏幕太小并且在任何特定时间只能查看这么多图像,而不是一次加载它们。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文