Simulation: FIFO, LFU and MFU Page ReplacementAlgorithms (VB)
Shaify Mehta (http://www.shaify.com)
Page replacement algorithm is an algorithm decides whichpages should be writing to disk when new page needs toallocated.Page replacement increases the system performance. Whilethere is also a possibility of picking a randomize page toremove during the page fault occurs, in this case systemperformance will be optimize if small sized pages is chosenrather than the heavily pages.Page replacement algorithms does the work on the basis of both theoretical and implementations. For example in case of web server, the web server keeps tracks of numbers of pagesin the memory cache. A new page is referenced when thememory cache is full. In this case web server decides whichpage is to be removed.
Page replacement takes the following procedure. If no frameis free, we find one that is not currently being used and free it.We can free the frame by making changing in the page tableto point that the page is no longer available in the memory.Now we can modify and use the page fault procedure toinclude page replacement.1)
Look out the location of the page on the memorydisk.2)
Look for a free frame
If free frame is available, use it.
Use page replacement algorithm to pick thevictim page in case of no free frame.
Write the victim page to the memory disk.Also make changes the entries in the frameand page table.3)
Read the particular page into newly allocated freeframe, change the frame and page tables accordingly.4)
Repeat the whole user process.There are many different page replacement algorithms.Every operating system probably has its own replacementscheme. Further we are going to discuss various types of algorithms of page replacement algorithms.
FIFO (First-In, First Out):
The simplest and low-overhead page replacementalgorithm is the FIFO (First-In, First Out) algorithm. AFIFO replacement algorithm links with each page thetime when that page was added into the memory; theoldest page is chosen when a page is going to be replaced.We can create a FIFO queue to hold all the pages present