• 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: iPhone resource cache - memory question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >iPhone resource cache - memory question (From: Philip Mobley <email@hidden>)

  • Prev by Date: Re: Authenticate NSFileManager Operations
  • Next by Date: Re: Authenticate NSFileManager Operations
  • Previous by thread: iPhone resource cache - memory question
  • Next by thread: Re: iPhone resource cache - memory question
  • Index(es):
    • Date
    • Thread