• 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
Eviction Policy in NSCache and NSDiscardableContent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Eviction Policy in NSCache and NSDiscardableContent


  • Subject: Eviction Policy in NSCache and NSDiscardableContent
  • From: Dalmazio Brisinda <email@hidden>
  • Date: Wed, 02 Mar 2011 10:31:58 +0700

I was looking at the NSCache class and the NSDiscardableContent protocol for an LRU-type cache. However the documentation doesn't say anything specific about the eviction policy used (apart from setting total cost and count limits), only that:

"The NSCache class incorporates various auto-removal policies, which ensure that it does not use too much of the system’s memory. The system automatically carries out these policies if memory is needed by other applications. When invoked, these policies remove some items from the cache, minimizing its memory footprint."

Can anyone shed some light on how NSCache decides on which items to evict?

If this can't be known, can anyone suggest an alternative to NSCache that implements an LRU-type eviction policy? Perhaps it might be possible to overlay an LRU-type eviction policy by careful implementation of the NSDiscardableContent protocol?

Best,
Dalmazio

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Prev by Date: Re: original image size is not retained when it is exported as PDF using CGImageDestinationRef
  • Next by Date: animating addSubview with iOS4
  • Previous by thread: Subview getting clipped by its parent view when scale transformation done
  • Next by thread: animating addSubview with iOS4
  • Index(es):
    • Date
    • Thread