Skip to content

MeowMeow0417/page-replacement-simulation

Repository files navigation

Page Replacement Algorithms – Case Study

This project presents an interactive simulation of three fundamental Page Replacement AlgorithmsFIFO, LRU, and OPT (Optimal Replacement)—built using React and TypeScript. Designed for both educational and demonstrative purposes, the application visualizes memory operations with animations, providing an intuitive understanding of how each algorithm behaves.


Tech Stack

  • React (TypeScript) – A powerful JavaScript library for building interactive user interfaces, enhanced with static typing using TypeScript.
  • Framer Motion – A production-ready motion library for React to create smooth, visually appealing animations.
  • Electron – A framework for building cross-platform desktop apps using web technologies like HTML, CSS, and JavaScript.
  • Node.js + npm – Node.js enables JavaScript to run server-side; npm is its package manager used to install and manage dependencies.

Algorithms Implemented

  1. FIFO (First-In, First-Out)

    • Replaces the page that entered memory first.
  2. LRU (Least Recently Used)

    • Replaces the page that hasn’t been used for the longest time.
  3. OPT (Optimal Replacement)

    • Replaces the page that won’t be used for the longest time in the future.

Each simulation visually represents:

  • 🟩 Cache Hits
  • 🟥 Cache Misses
  • 🔄 Page Evictions

How to Run the Application

Option 1: Run the Executable

  1. Go to the executable/ directory.
  2. Download and unzip one of the following based on your OS:
    • Cache Simulator Setup 1.0.0.exe.zip
    • Cache Simulator-1.0.0.dmg.zip
  3. Run the extracted .exe (Windows) or .dmg (macOS) file.

Option 2: Run from the Live Site

You can also access the application instantly without setup by visiting the live deployment:

https://page-replacement-simulation-zeta.vercel.app

Just open this URL in any modern browser to use the interactive page replacement simulation online.


📄 Documentation

The full case study is available at: docs/OS CASE STUDY - Gilbert Cura.pdf


Screenshots

image
FIFO Algorithm

image
LRU Algorithm

image
OPT Algorithm

Author

Gilbert Cura Final Project – Chapter 10: Page Replacement Algorithms