iosipadmemorymemory-warning

Memory warning threshold value for all iPad version


There are memory warning level 1 and level 2 for iOS app. The question is for all iPad devices (from iPad 1 to iPad 4, mini ) , what is the responding threshold value to send out the warnings. For instance, for iPad1, is that 100 MB ?

Thanks


I also used to print out memory used when received memory warning.

#import "mach/mach.h"
-(void) report_memory {

    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 ) {
        DLog(@"Memory in use (in MB ): %u", info.resident_size/1024/1024);
    } else {
        DLog(@"Error with task_info(): %s", mach_error_string(kerr));
    }
}

Solution

  • I don't think it is officially documented by Apple, mainly because it may change between iOS versions, but these are the figures stated in the "Learn iPhone and iPad cocos2d Game Development" book:

    +-----------------------------------------------------------------+  
    | Installed Memory |  Available Memory | Memory Warning Threshold |
    +-----------------------------------------------------------------+  
    | 128 MB           |  35-40 MB         |  20-25 MB                | 
    | 256 MB           |  120-150 MB       |  80-90 MB                | 
    | 512 MB           |  340-370 MB       |  260-300 MB (estimated)  |
    +-----------------------------------------------------------------+