Monday 24 November 2014

Algorithms used in caching


As you know cache is limited in size. So whenever cache is full, there should be some way to free it. I mean whenever cache is full, some object/objects should be removed from cache, to make some room available for new objects. The algorithm you choose defines what object should be removed from cache.

Algorithm
Description
LFU (Least frequently used)
Remove the object that used least frequently
LRU (Lease recently used)
Remove the object that least recently used.
MRU (Most recently used)
Remove the object that used most recently
FIFO (First in first out)
Remove the object in first come first serve way.
Based on size
Remove the object which uses more memory of cache.
Based on time
Remove the object that takes less time to create.


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment