Skip to content
Simulation and data analysis of 4 different page replacement algorithms, written in Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

#VMsim @author Tony Poerio

Simulation and Data Analysis for 4 different Page Replacement Algorithms

Algorithms Simulated

* OPT --> the optimal page replacement algorithm, used as a baseline in our data analysis, because it requires perfect future knowledge and is therefore not possible to implement in a real system.
* Clock --> Second-chance 'clock' algorithm
* Aging --> Aging algorithm that approximates LRU
* LRU --> Exact LRU (Least Recently Used) page replacement algorithm

Usage notes

This is a python program. Please run it from the command line like so:

  • Opt – Simulate what the optimal page replacement algorithm would choose if it had perfect knowledge
    • EXAMPLE RUN: python –n 8 –a opt gcc.trace
  • Clock – Use the better implementation of the second-chance algorithm
    • EXAMPLE RUN: python –n 16 –a clock swim.trace
  • Aging – Implement the aging algorithm that approximates LRU with an 8-bit counter
    • EXAMPLE RUN: python –n 32 –a aging –r 1 gcc.trace
  • LRU – Do exact LRU.
    • EXAMPLE RUN: python –n 64 –a lru swim.trace

Data Analysis

Analysis can be found in:

Source code for the graphs can be found in:

You can’t perform that action at this time.