Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mademo

macrumors newbie
Original poster
Aug 12, 2008
3
0
Hi all,

I'm using the camera view within my app to take pictures. Very often either when taking the picture or saving it, I get a mem warning that makes the application to terminate. I know that the camera view + saving the photo brings the mem usage suddenly up to 17,5 MB. I'd like to know if any of you guys experienced a similar issue as well and any potential solution to the problem.

Thanks a lot!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Hm, I've been experiencing crashes when using the camera, and haven't figured out why yet (haven't really looked into it much, and crash logs are worthless). If the camera is taking a lot of memory, I'd suggest just prepare your app to release heavy objects before you use the camera, and then after the camera is done being used, load back your objects.
 

mademo

macrumors newbie
Original poster
Aug 12, 2008
3
0
Hm, I've been experiencing crashes when using the camera, and haven't figured out why yet (haven't really looked into it much, and crash logs are worthless). If the camera is taking a lot of memory, I'd suggest just prepare your app to release heavy objects before you use the camera, and then after the camera is done being used, load back your objects.

Hi,

by using Instruments > Activity Monitor I figured out that the process of taking and saving photos takes up to 20+ MB. I need to implement a smart memory management in order not to make my app run out of memory, hence crash (since an app is allocated by iPhone OS at most 30 MB from what I see).

BTW, it is really a bummer that the camera eats up so much memory. This limits somewhat an app and forces people to put in place all the possible tricks to manage every single byte of memory.
 

Ron C

macrumors member
Jul 18, 2008
61
0
Chicago-area
(me == noob)?

I hate to be such a noob weenie, but when you say "camera view," are you talking about using the camera on the device? How exactly might one go about doing that? I've been looking at bits of the sample code trying to figure that out without much luck. (Oh, I searched here too before I dropped this in here, hopeful someone may grace me with a bit of assistance.)

I have an app idea where I'd like to use the camera to take a picture of something then do something with that image.

Thanks!

Ron C
 

Taum

macrumors member
Jul 28, 2008
56
0
Check out the video on the iPhone developer connection : "Using iPhone features in your application" (from approximately 3:10 to 5:10).
 

Ron C

macrumors member
Jul 18, 2008
61
0
Chicago-area
Thanks, I'll do that.

I also stumbled across UIImagePickerController (say "Thank you" to Terminal and grep - being old^h^h^hexperienced has some advantages) and found a nice tutorial via a google search.

Ron C
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.