Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1003483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:59:15+00:00 2026-05-16T07:59:15+00:00

I am writing an application that uses UIImagePickerController to take multiple pictures with the

  • 0

I am writing an application that uses UIImagePickerController to take multiple pictures with the camera as fast as iOS allows. My application has to run on iOS 3.13 on all versions of iPhone hardware (v1 through 4). I am using UIImagePickerController with a cameraOverlayView.

My question is, how can I determine programmatically how many photos can be processed at once based on available memory? See below for more details. Any help is appreciated!

When the imagePicker delegate recieves imagePicker:didFinishPickingMediaWithInfo:, the delegate saves the full size image in the savedPhotosAlbum with UIImageWriteToSavedPhotosAlbum(). Once I have this problem solved, the app will be doing more things with the full size image.

As a test, I take pictures as fast as I can. Eventually, as expected, the app receives memory warning due to the large number of photos in memory while saving to the photo album. If I ignore the memory warnings and continue taking pictures, eventually the app is killed by iOS b/c of this.

I have no problem with setting a limit on the number of concurrent photos I allow the app to process at a time. Each iPhone HW version has different memory capacities and different camera resolutions. With iOS 4, multi-tasking may also effect the available memory. I’d rather do this programmatically than hard-code a limit based on HW version.

A test application that shows this behavior is at Source Code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:59:15+00:00Added an answer on May 16, 2026 at 7:59 am

    It’s easier to hard-code the limit.

    There’s no easy way to find out what the “available memory” is, since more memory may suddenly become free if there’s a memory warning, or if the phone decides to kill various background apps (namely Safari). There’s NSRealMemoryAvailable(), but that might just return the installed RAM (and is probably what [NSProcessInfo physicalMemory] uses).

    You could try saving images in a queue — saving one image at a time is likely to use less memory. You can also add markers to your queue when you receive a memory warning, and disable image-saving when there’s more than one (ideally you want to stop taking pictures if you get “level 2” or “level 3” memory warnings, but while these are printed to the console, I don’t know any easy way of checking in code. Presumably you want to resume on a memory un-warning, but these don’t exist either).

    Also note that you can get the raw JPEG data (on some OS versions) through a notification; I forget what the name is, but the userInfo key is @”AVCaptureNotificationInfo_JPEGData”. If you save the raw JPEG data, you might be able to process it later.

    I think UIImageWriteToSavedPhotosAlbum() stupidly decompresses the JPEG returned by the camera and recompresses it, but I could be wrong. Camera images are only around 1-2 MB, so you ought to be able to take plenty without it crashing, but in my tests that’s not the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application that uses UIImagePickerController. I'd like to give users choice of
I am writing an Android application that uses some functionality that has been published
I'm writing an Android application that uses the camera. I'm setting camera display orientation
I'm writing an application that uses renaming rules to rename a list of files
I am writing a C# application that uses a long hard-coded string. For maintainability
I am writing a web application that uses a JSP usebean tag in the
I'm writing a WPF application that uses a component, and this component returns a
I'm currently writing an iPhone application that uses a UITabBarController with more than 5
So I'm writing a Java application that uses Simple to store data as xml
I'm writing an application in PHP that uses a LOT of global variables that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.