Eviction policy
An eviction policy is a rule for selecting stored items to remove when capacity, retention, or resource constraints require their removal.
Fast by Default
An eviction policy defines which retained data or cached entries are removed when a resource bound is reached.
- How it is used
- Keeps caches and retained application state within explicit memory bounds as usage and data grow.
- How deep it goes
- Gives implementation guidance through size limits, LRU and last-access rules, monitoring, and long-session testing without algorithm internals.
- Examples
- Uses growing caches, distributed profile invalidation, photo-editor undo copies, and document caches evicted by last access.
- What you can do after
- Apply it by setting bounded cache and retained-state limits, selecting removal rules, and monitoring memory growth over extended sessions.
Advanced Algorithms and Data Structures
An eviction policy is a rule for selecting an element to remove from a full cache when space is needed for a new entry.
- How it is used
- Controls which cache entry is purged when fixed capacity must make room for a new entry.
- How deep it goes
- Defines the rule, compares LRU and LFU, and traces priority-queue implementation trade-offs without covering concurrency design in detail.
- Examples
- Uses least-recently-used removal, frequency counters, timestamps, priority queues, heaps, and custom age- or importance-weighted metrics.
- What you can do after
- Build a cache policy by selecting a retention metric and matching it with lookup and ordering data structures.
Read how Advanced Algorithms and Data Structures explains eviction policy →
Also covered in
- The Art of Code
- Designing AI AgentsIn early access (MEAP)
- Amazon Web Services in Action, Third Edition: An in-depth guide to AWS
What to know first
- cachingCaching is the temporary storage of data or computed results for reuse, reducing the work or delay of retrieving or computing them again.
- memoryMemory is a storage capability or mechanism for retaining information or computational state for later access or use.
Related concepts
- cachinguses · Caching is the temporary storage of data or computed results for reuse, reducing the work or delay of retrieving or computing them again.
- decision qualitymeasured by · Decision quality is the degree to which a choice is well-reasoned and suitable given the information, assumptions, preferences, alternatives, and objectives available when it is made.
- policykind of · A policy is a rule, principle, or decision function that governs behavior or determines actions or permissions under specified conditions.
- least frequently usedused by · Least frequently used is a cache-eviction policy that removes the entry with the lowest access frequency when capacity is exhausted.
Questions about eviction policy
What is eviction policy?
An eviction policy is a rule for selecting stored items to remove when capacity, retention, or resource constraints require their removal.
Which Manning books explain eviction policy?
Fast by Default and Advanced Algorithms and Data Structures.
What should I know before learning eviction policy?
Manning books that teach eviction policy usually introduce caching and memory first.
What kinds of eviction policy are there?
Kinds of eviction policy include volatile-lru.
What is eviction policy a kind of?
Eviction policy is a kind of policy. A policy is a rule, principle, or decision function that governs behavior or determines actions or permissions under specified conditions.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

