What is LFU (Least Frequently Used)?

LFU stands for Least Frequently Used, and it’s like a game where the thing you use least gets sent away to make room for new things.

Imagine you have a toy box with only 5 spots, and every time you want a new toy, you have to pick one out of the box to put it in. If you play with some toys more than others, like your favorite dinosaur or your shiny red car, they stay in the box because you use them often. But if you barely touch your old wooden train, that’s the one that gets sent away.

That’s how LFU works in computers! It helps decide which data to keep and which to remove when there's no space. The data that is used least often gets removed first, just like that old wooden train.

How it compares to other ways of playing

Sometimes, instead of sending away the toy you use least, you send away the one you used last, that’s like LRU (Least Recently Used). But LFU looks at how often you use your toys, not just when you last played with them.

So next time you're choosing which toy to keep and which to put aside, remember: LFU is all about the favorites!

Take the quiz →

Examples

  1. A computer uses LFU to decide which app to close when it runs out of memory, based on how often each app is used.
  2. Imagine a classroom where the teacher removes the student who has spoken the least in class, that’s like LFU.
  3. When your phone starts slowing down, it might be using LFU to free up space by removing the apps you use the least.

Ask a question

See also

Discussion

Recent activity

Categories: History · LFU· cache· memory management