views:

308

answers:

1

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.

A: 

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.

Ole Begemann