• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Allocating too much memory kills my App rather than returning NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocating too much memory kills my App rather than returning NULL


  • Subject: Re: Allocating too much memory kills my App rather than returning NULL
  • From: David Duncan <email@hidden>
  • Date: Thu, 10 Nov 2011 09:48:31 -0800

On Nov 10, 2011, at 9:33 AM, James Montgomerie wrote:

> On 9 Nov 2011, at 17:33, Dave Camp wrote:
>> This was discussed at a WWDC session a couple of years ago. If your app attempts to allocate a large block of memory, and the OS cannot get other processes to give up memory in a timely fashion, your app will be killed.
>>
>> It's the reverse of you getting the low memory messages. As you take up more and more memory, the OS has to send the low memory messages to other apps to get them to release memory for you. If you allocate memory faster than the OS can re-claim it from other processes, your app will be terminated.
>
> Maybe you didn't mean it this way, but this makes sound as if the foreground app never gets memory warnings, it's just terminated if it uses too much RAM.  This is not true.  In general, the opposite is true - other apps that have been suspended are not 'woken up'  just to be given warnings - they're just terminated.


Your both right.

The foreground application will receive memory warnings, but memory warnings are an event, just as much as touches are. What that means is that if your application is consuming memory slowly and returning to the event loop often, you will get memory warnings. But if your application is in a tight loop on the main thread forcing the allocation of lots of physical pages, then you can and will get killed without having "received" a memory warning.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Jens Alfke <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Greg Parker <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Wade Tregaskis <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Joar Wingfors <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Conrad Shultz <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Dave Camp <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: James Montgomerie <email@hidden>)

  • Prev by Date: Re: Logging in Xcode 4.2
  • Next by Date: Re: Allocating too much memory kills my App rather than returning NULL
  • Previous by thread: Re: Allocating too much memory kills my App rather than returning NULL
  • Next by thread: Re: Allocating too much memory kills my App rather than returning NULL
  • Index(es):
    • Date
    • Thread