tushar-c23 / PageReplacement_Algorithms

Page replacement algorithms to analyse page fault and belady's anomaly.
MIT License
0 stars 1 forks source link
least-recently-used-algorithm most-recently-used operating-systems page-replacement-algorithm

PageReplacement_Algorithms

Page replacement algorithms to analyse page fault and belady's anomaly and thrashing.

Algorithms

  1. Least Recently Used (LRU)
  2. Most Recently Used (MRU)

Some Useful Information

Flags

How to run

  1. Clone the repository
  2. Run the following commands in the terminal to compile the code:
    g++ mru.cpp pbPlots.cpp supportLib.cpp -lm -o mru
    g++ lru.cpp pbPlots.cpp supportLib.cpp -lm -o lru
  3. Run the following commands in the terminal to generate plots:
    ./mru <maxFrameSize> <maxPageArraySize> -<flag>
    ./lru <maxFrameSize> <maxPageArraySize> -<flag>

    Replace the placeholders with the desired values. [^1]

This program will generate plots for the algorithms in "./plots/" folder.

Naming convention for the plots is as follows: "\<Algorithm Name>-\<flag>-\<maxFrameSize>-\<maxPageArraySize>"

[^1]: Note: All three command line args must be provided.