Nepedia
Back to Discover
Independent Reader
💻

Cache replacement policies

technology Maturity 7-9 Next article →

Computers use a fast storage area called a cache. It keeps data that the computer uses often. This helps the computer work much faster. But the cache has a small size. When it is full, the computer must pick something to toss. This set of steps is called a replacement policy.

Lruexample
Lruexample

One way is called First In, First Out. This works like a line at a store. The oldest item is the first to leave. Another way is Last In, First Out. This works like a stack of books. The newest item is tossed first.

Many computers use a way called Least Recently Used, or LRU. This method looks at when things were used. It tosses the item that has not been used for the longest time.

Lruexample
Lruexample

Some systems use Most Recently Used, or MRU. This tosses the item used most recently. This can be helpful if a computer scans files in a loop.

Mruexample
Mruexample

Other ways are simpler. Random replacement picks an item by chance. It does not need to track history. This is very simple to do.

Lruexample
Lruexample
178 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (7)
File:Beladysalgoworking.png
Beladysalgoworking.png
File:Lruexample.png
Lruexample.png
File:Mruexample.png
Mruexample.png
File:Plruexample.png
Plruexample.png
File:Mockingjay Description.svg
Mockingjay Description.svg
File:LIRSalgoworking.png
LIRSalgoworking.png
File:MultiQueueReplacementAlgortithm.jpg
MultiQueueReplacementAlgortithm.jpg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.