Open In App

LFU Full Form

LFU stands for Least Frequently Used. It is a cache algorithm that is used to optimize the memory of the computer. In this algorithm, the system keeps a track of how many times a block is referred in memory. When the cache memory is completely filled and demands more room, then the item with the lowest reference frequency is removed. 
Three operations performed by LFU are – Set (insert ), Retrieve(lookup), Evict(delete). 

 



 



Implementation

A simple approach is that we assign a counter to each block that appears in memory. Now, every time the block reappears the counter increases by one. When cache memory is completely filled and a new block has to be inserted then the block with the minimum counter value will be removed from the cache memory and the new value will be inserted. When the block is removed from cache memory then the counter for that block is initialized to zero. 

Characteristics

Advantages

Disadvantages

Article Tags :