Mechanism for Cache Eviction/Replacement
Typical approach: maintain an ordered free/inactive list of slots that are candidates for reuse.
- Busy items in active use are not on the list.
E.g., some in-memory data structure holds a pointer to the item.
E.g., an I/O operation is in progress on the item.
- The best candidates are slots that do not contain valid items.
Initially all slots are free, and they may become free again as items are destroyed (e.g., as files are removed).
- Other slots are listed in order of value of the items they contain.
These slots contain items that are valid but inactive: they are held in memory only in the hope that they will be accessed again later.