One possibility is to install a CFRunLoopObserverRef that would query for available memory, using task_info on mach_task_self(). Then you can check if you start to are coming nearer to "dangerous territories". Not perfect though as usually the moment you can not alloc some memory it can be already too late
laurent On Tuesday, April 20, 2010, at 07:17PM, "Nick Zitzmann" <[email protected]> wrote: > >On Apr 20, 2010, at 10:10 AM, Bill wrote: > >> Does there exist a low-memory warning for Mac apps similar to the >> didReceiveMemoryWarning for the iPhone? I have looked at NSCache and other >> related classes, but for my purposes it would be better to simply receive a >> low memory warning and then act on the warning. Does such a warning exist >> for the Mac? > >Unfortunately no, but that would be a good idea, especially in 32-bit apps. >Have you filed an enhancement request? > >Nick Zitzmann ><http://www.chronosnet.com/> > >_______________________________________________ > >Cocoa-dev mailing list ([email protected]) > >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/lcerveau%40me.com > >This email sent to [email protected] > > _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
