0

Possible Duplicate:
iPhone OS Memory Warnings. What Do The Different Levels Mean?

what is a memory warning, how do we respond to it

Community
  • 1
  • 1
rambabu459
  • 121
  • 2
  • 10

1 Answers1

5

Check this SO question

iPhone OS Memory Warnings. What Do The Different Levels Mean? Check Kenny's answer

Memory level warnings are logged by SpringBoard. As an app developer you don't need to care about it. Just responding to -{application}didReceiveMemoryWarning is enough.

There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel().

typedef enum {
    OSMemoryNotificationLevelAny      = -1,
    OSMemoryNotificationLevelNormal   =  0,
    OSMemoryNotificationLevelWarning  =  1,
    OSMemoryNotificationLevelUrgent   =  2,
    OSMemoryNotificationLevelCritical =  3
} OSMemoryNotificationLevel;

How the levels are triggered is not documented. SpringBoard is configured to do the following in each memory level:

  1. Warning (not-normal) — Relaunch, or delay auto relaunch of nonessential background apps e.g. Mail.
  2. Urgent — Quit all background apps, e.g. Safari and iPod.
  3. Critical and beyond — The kernel will take over, probably killing SpringBoard or even reboot.

Killing the active app (jetsam) is not handled by SpringBoard, but launchd.

UPDATE

Pls go through the Apple Reference documents on Memory Management also

Community
  • 1
  • 1
visakh7
  • 26,380
  • 8
  • 55
  • 69