Giter Site home page Giter Site logo

page-replacement's Introduction

page-replacement

Original project – VMsim by Tony Poerio.

Simulation and data analysis for 4 different page replacement algorithms.

Algorithms

  • Clock. More efficient version of the second chance algorithm (FINUFO, First In Not Used First Out), because the pages do not have to be constantly moved to the end of the list, while they fulfill the same general function as the second chance.

  • LRU – Least Recently Used. This algorithm assumes that pages that were most often used in the past will also be the most commonly used in the future. While LRU provides in theory almost optimal performance, it is expensive to implement.

  • OPT – optimal. Used as a baseline in the analysis, because it requires perfect future knowledge and is therefore not possible to implement in a real system. Also known as the Bélády algorithm.

  • Aging – approximate LRU. The aging algorithm derives from the NFU (Not Frequently Used) algorithm. Each page in the page table has its own counter.

Usage notes

Requires Python 3.

Main program. 3 arguments can be passed:

  • --numframes – number of frames in RAM. Required

  • --refresh – refresh time [ms] for aging algorithm. Optional

  • --tracefile – path to the source file (should contain 32b addresses with memory access type). Required

E.g. run:

$ python vmsim.py --numframes 8 --refresh 6 --tracefile data/100000.trace

Generates trace file. Parametrized with file size. E.g.:

$ python generator.py --pages 500000

Output directory is data/.

Bash script used for measurement.

The script is parameterized with two data arrays (traces & frames). It runs two scripts in Python – generator and vmsim.

Firstly, 3 files with input data (trace files) are generated. Then for each of the files all algorithms are executed for each frame length.

9 CSV files in results/ are produced as a result.

Simply run:

$ ./run.sh

Analysis

Tables and charts can be found here.

There's also a wiki page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.