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

  • Home
  • SEARCH
  • 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 8982449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:34:54+00:00 2026-06-15T20:34:54+00:00

UPDATE This piece of code is actually not where the problem is; commenting out

  • 0

UPDATE This piece of code is actually not where the problem is; commenting out all the CoreGraphics lines and returning the first image in the array as the result does not prevent the crashes from happening, so I must look farther upstream.

I am running this on a 75ms NSTimer. It works perfectly with 480×360 images, and will run all day long without crashing.

But when I send it images that are 1024×768, it will crash after about 20 seconds, having given several low memory warnings.

In both cases Instruments shows absolutely normal memory usage: a flat allocations graph, less than one megabyte of live bytes, no leaks the whole time.

So, what’s going on? Is Core Graphics somehow using too much memory without showing it?

Also worth mentioning: there aren’t that many images in (NSMutableArray*)imgs — usually three, sometimes two or four. Crashes regardless. Crashes slightly less soon when there are only two.

- (UIImage*) imagefromImages:(NSMutableArray*)imgs andFilterName:(NSString*)filterName {

    UIImage *tmpResultant = [imgs objectAtIndex:0];

    CGSize s = [tmpResultant size];

    UIGraphicsBeginImageContext(s);

    [tmpResultant drawInRect:CGRectMake(0, 0, s.width, s.height) blendMode:kCGBlendModeNormal alpha:1.0];

    for (int i=1; i<[imgs count]; i++) { [[imgs objectAtIndex:i] drawInRect:CGRectMake(0, 0, s.width, s.height) blendMode:kCGBlendModeMultiply alpha:1.0]; }

    tmpResultant =  UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return tmpResultant;
}
  • 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-06-15T20:34:55+00:00Added an answer on June 15, 2026 at 8:34 pm

    Sounds to me like the problem is outside of the code you have shown. Images that are displayed on screen have a backing store outside of your app’s memory that is width*height*bytes_per_pixel. You also get memory warnings and app termination if you have too many backing stores.

    You might need to optimize there, to either create smaller optimized versions of these images for display or to allow for the backing stores to be released. Also turning on rasterization for certain non-changing layers can help here as well as setting layer contents directly to the CGImage as opposed to working with UIImages.

    You should make a sample project that demonstrates the issue that has no other code around it and see if you still run out of memory. But as I suspect you’ll find that just with the code you have shown you will not be able to reproduce the isse as it lies elsewhere.

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

Sidebar

Related Questions

I have this piece of code, and I need to target only the first
I have a problem with this piece of code, when I do my intersect
I have this piece of code which I am using to update some values
Update: This is, as I was told, no principle Python related problem, but seems
UPDATE: This question is out of date, but left for informational purposes. Original Question
Update: This issue was not properly explored. The real issue lies within render :json
UPDATE: This is the working example. First we create a class to hold weekday,
I have this piece of code here below: $fq.= + (fritidsboende_uth_from:[$fritids_uth_from TO *] AND
I've run into a very annoying problem while trying to update some code. The
I have seen a piece of code that I can't figure out: for (var

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.