On 10 Nov 2011, at 17:52, Kyle Sluder wrote: > On Nov 10, 2011, at 9:33 AM, James Montgomerie <ja...@montgomerie.net> 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. > > Read carefully: “If you allocate memory faster than the OS can re-claim it > from other processes…” In other words, the system protects against apps that > might've gotten trapped in an infinite loop of allocating memory. Better to > kill the errant app without sacrificing other apps to its unsatisfiable > demands.
Oh, yes, certainly - that's why I later said "I'm skeptical that it [listening for them while in an allocation loop] will work at all, given the rate of allocation you'll have and how long it might take you to clean things up". Reading my message again though, it is rather unclear itself (especially for a message attempting to clarify things...) What I was trying to say is that, contrary to the impression that might be being given (and that, again, that I don't think Dave meant to imply) it's not true that a foreground app /never/ gets memory warnings; under most circumstances it will. Jamie. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com