开发者

iPhone Memory Warning with Camera, but not Photo Library

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜