Re: iPhone resource cache - memory question
Re: iPhone resource cache - memory question
- Subject: Re: iPhone resource cache - memory question
- From: David Duncan <email@hidden>
- Date: Wed, 5 May 2010 16:39:34 -0700
On May 5, 2010, at 4:27 PM, Philip Mobley wrote:
> I am designing a slightly smarter resource cache that purges less frequently used resources instead of a purge all when getting an UIApplication delegate "applicationDidReceiveMemoryWarning:" message. I know the target (currently) is 20 MBs (although that could change with future hardware). The problem I am running into is finding out if I have purged enough.
What I would probably do is have each cached object check in with a size, and track the total cache size separately. When you get a memory warning, shrink the cache by about half. If the cache is under a certain size (say 5MB) just purge the entire thing.
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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