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 7898855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:32:54+00:00 2026-06-03T08:32:54+00:00

I have been developing an application for iPad that is very graphically intensive. I

  • 0

I have been developing an application for iPad that is very graphically intensive. I have been able to squeeze quite a bit of performance out already on the iPad 2, but the @2x graphics for the new iPad are packing quite the punch in the memory department. Using the Activity Monitor in Instruments I am able to see the size of my application mushrooming into the 300MB-400MB range but I do not receive any low memory notifications. I am using a UINavigationController to manage my views, so getting down into the stack has a cumulative effect on memory that ends in its eventual termination. I do not experience this problem on the iPad 2, where I receive low memory notifications as expected. My app has been coded to clean up as much as possible and performs very well on that device.

I have read a number of similar questions asked:

IOS app killed for Low Memory but no Memory Warning received
iPhone app uses 150 MB memory and still no low memory warning!

None of the suggestions seem to help.

I have inserted code to force a low-memory notification to be sent:

[[UIApplication sharedApplication] _performMemoryWarning];

This does cause the inactive views to unload as expected and returns memory consumption to normal. This uses a private API and is hack, so for practical reasons is not a solution. How do I get my device to properly respond to low memory conditions and let my app know that it needs to clean up??

  • 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-03T08:32:55+00:00Added an answer on June 3, 2026 at 8:32 am

    This problem was fixed in iOS 5.1.1. For those users who are on 5.1, I have implemented my own memory watchdog and sending out a notification similar to the one used when a real memory warning is issued.

    I first created a category on UIApplication. This posts a notification that UIImage listens for (or whatever its backing cache is) to unload cached images.

    .h

    @interface UIApplication (ForceLowMemory)
    
    + (void) forceUnload;
    
    @end
    

    .m

    #import "UIApplication+ForceLowMemory.h"
    
    @implementation UIApplication (ForceLowMemory)
    
    + (void)forceUnload {
        [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification 
                                                            object:[UIApplication sharedApplication]];
    }
    
    @end
    

    Next, I created a memory manager watchdog like the following:

    .h

    @interface ELMemoryManager : NSObject
    
    - (void)startObserving;
    - (void)stopObserving;
    
    + (ELMemoryManager*) sharedInstance;
    
    @end
    

    .m

    #import "ELMemoryManager.h"
    #import "UIApplication+ForceLowMemory.h"
    #import <mach/mach.h>
    
    @interface ELMemoryManager()
    
    @property (nonatomic, retain) NSTimer *timer;
    uint report_memory(void);
    
    @end
    
    #define MAX_MEM_SIZE 475000000
    
    @implementation ELMemoryManager
    @synthesize timer = timer_;
    
    static ELMemoryManager* manager;
    
    #pragma mark - Singleton
    
    + (void) initialize {
        if (manager == nil) {
            manager = [[ELMemoryManager alloc] init];
        }
    }
    
    + (ELMemoryManager*) sharedInstance {
        return manager;
    }
    
    #pragma mark - Instance Methods
    
    uint report_memory(void) {
        struct task_basic_info info;
        mach_msg_type_number_t size = sizeof(info);
        kern_return_t kerr = task_info(mach_task_self(),
                                       TASK_BASIC_INFO,
                                       (task_info_t)&info,
                                       &size);
        if( kerr == KERN_SUCCESS ) {
            return info.resident_size;
        } else {
            return 0;
        }
    }
    
    - (void)startObserving {
        if (!self.timer) {
            NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:5.0f target:self selector:@selector(checkMemory:) userInfo:nil repeats:YES];
            self.timer = timer;
        }
        [self.timer fire];
    }
    
    - (void)stopObserving {
        [self.timer invalidate];
        self.timer = nil;
    }
    
    - (void)checkMemory:(id)sender {
        uint size = report_memory();
        if (size > MAX_MEM_SIZE) {
            NSLog(@"we've busted the upper limit!!!");
            [UIApplication forceUnload];
        }
    }
    
    #pragma mark - Memory Management
    - (void)dealloc {
        [self.timer invalidate];
        [timer_ release];
        [super dealloc];
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an iPad application. I have been provided with a PNG image that
I have an iPad application that I have been developing on simulator just fine
I have been developing an application that required the SQLite database file to be
I have been developing a Silverlight application using WCF. The problem is that sometimes
I have been developing a quite large application, and I uploaded it to my
I have been developing an application that can publish content like some sort of
I have been developing an application that uses Models that are based on a
I have been developing an iPad application in which I want to implement multithreading,
Right, I have been tasked with developing a new application in MVC3 that unfortunately
I have been developing Android application for Android 3.x and now I want to

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.