iPhone 相机内存警告,但照片库不警告

发布于 2024-08-19 13:45:30 字数 334 浏览 3 评论 0原文

在相机模式下按下 UIImagePickerController 上的“使用”按钮后,我一直收到内存警告。

我第一次使用 Instruments 试图弄清楚发生了什么,但我没有发现问题。在打开图像选择器控制器之前,我的应用程序使用了约 2.0 MB 的内存。看起来相机模式和照片库模式都分配了 9.0 MB 内存,但我只在相机模式下收到内存警告。

我可以尝试在打开控制器之前释放一些内存,但我的使用率已经很低了。我不明白为什么两个控制器都会增加相同数量的内存使用量,但我从未收到来自照片库的警告。事实上,我已经能够多次打开照片库并保留图像(内存使用量为 33+ MB),没有任何问题。

所有建议将不胜感激。

I'm consistently receiving a memory warning right after pressing the "Use" button on the UIImagePickerController in Camera mode.

I used Instruments for the first time to try to figure out what's going on, but I don't see a problem. Before opening the image picker controller, my app is using ~2.0 MB of memory. It looks like both Camera mode and Photo Library mode allocate 9.0 MB of memory, but I only receive a memory warning in Camera mode.

I could attempt to free some memory before opening the controller, but my usage is already pretty low. I don't understand why both controllers increase my memory usage by the same amount, but I never receive a warning from the Photo Library. In fact, I've been able to open the Photo Library multiple times and retain the image (putting memory usage at 33+ MB) with no problem.

All suggestions will be appreciated.

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

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

发布评论

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

评论(1

夏末染殇 2024-08-26 13:45:30

相机很可能在不同的进程中运行(我在这里推测),并且其内存使用量不会计入您的应用程序。无论如何,内存警告并不表明您做错了什么。不要尝试提前释放内存,只需响应内存警告就可以了。

It's quite possible that the camera runs in a different process (I'm speculating here) and that its memory usage does not count against your app. Regardless, memory warnings are not an indication that you are doing anything wrong. Don't try to free up memory in advance, just respond to memory warnings and you should be fine.

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