This program implements the MFU (Most Frequently Used) Page Replacement Algorithm from the page replacement algorithms. The MFU algorithm is used to manage the pages in memory efficiently. It helps in minimizing the number of page faults by replacing the most frequently used pages when the memory is full.
- Compile and run the program.
- Enter the maximum number of pages that can be held in memory when prompted.
- Enter the page numbers that need to be accessed (enter -1 to terminate).
- Or you can directly use the (.exe) file that is available in the (Executable File) folder.
***********************************************************************************
*** Enter the maximum number of pages that can be held in memory: 3
***********************************************************************************
*** Enter the page numbers (enter -1 to terminate): 1 2 3 4 1 2 5 -1
***********************************************************************************
---> Page 1 is loaded into memory.
***********************************************************************************
---> Page 2 is loaded into memory.
***********************************************************************************
---> Page 3 is loaded into memory.
***********************************************************************************
---> Page 4 is evicted from memory.
***********************************************************************************
---> Page 1 is already in memory.
---> Page 2 is already in memory.
***********************************************************************************
---> Page 5 is loaded into memory.
***********************************************************************************
---> Total Page Faults: 3
***********************************************************************************
-
main.cpp: A sample program that uses the MFU page replacement algorithm.
-
PageReplacement.h: Contains the declaration of the abstract base class PageReplacement, which represents a page replacement algorithm.
-
PageReplacement.cpp : Implements the functionality of the PageReplacement class.
-
MFU_PageReplacement.h: Contains the declaration of the MFU_PageReplacement class, which is a derived class of PageReplacement.
-
MFU_PageReplacement.cpp: Implements the functionality of the MFU_PageReplacement class.
-
Object File : Contains the machine code of the program and the necessary information for linking.
-
Executable File : Contains the .exe file as the program's executable file.
-
Feel free to explore the code and make any modifications or improvements as needed.
BOOK:
- Modern Operating Systems Book by Andrew Tanenbaum.
- Operating System Concepts Book by Abraham Silberschatz.