liveBook · Manning

LRU

LRU is a cache replacement policy that evicts the item whose most recent access occurred furthest in the past.

How 2 Manning books explain it

Advanced Algorithms and Data Structures

An LRU cache is a cache that evicts the entry that has been unused for the longest time when it reaches capacity.

How it is used
Uses caching to avoid repeated computation while retaining fast lookup, insertion, retrieval, sizing, and eviction.
How deep it goes
Develops the hash-table and doubly-linked-list design through pseudocode, synchronized updates, and amortized constant-time analysis.
Examples
Uses company-name entries, an Acme cache miss, an EvilCorp update, and diagrams or pseudocode for insertion and eviction.
What you can do after
Build it from scratch with a capacity, hash table, doubly linked list, head, tail, insertion, lookup, update, and eviction operations.

Read how Advanced Algorithms and Data Structures explains LRU →

Designing Deep Learning Systems: A guide for software engineers

The least recently used algorithm evicts the item that has gone unused for the longest time when a cache reaches its capacity.

How it is used
Manages model swapping in multitenant prediction services when memory or GPU capacity cannot hold every required model.
How deep it goes
Defines the eviction role and pairs it with model partitioning, but defers detailed cache implementation to a prediction-service example.
Examples
Uses a multitenant prediction service and an intent-classification service to illustrate model caching and swapping.
What you can do after
Operate model caches that evict inactive models and free capacity for incoming prediction requests.

Read how Designing Deep Learning Systems: A guide for software engineers explains LRU →

Related concepts

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.