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.


🧠 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.

⚠️ Executables are zipped to comply with GitHub’s 25MB file size limit.


🔹 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


✨ Features

✅ Fully commented and organized source code ✅ Smooth animated visualizations using Framer Motion ✅ Step-by-step simulation of memory operations ✅ Support for custom input sequences and cache sizes ✅ Cross-platform executables for Windows and macOS


🛠 Tech Stack

  • React (TypeScript)
  • Framer Motion
  • Electron
  • Node.js + npm

📷 Screenshots

Screenshots are embedded in the docs/OS CASE STUDY - Gilbert Cura.pdf file.

They showcase:

  • Input sequences for FIFO, LRU, and OPT
  • Output states of memory frames
  • Visual feedback for hits, misses, and page replacements

👤 Author

Gilbert Cura Final Project – Chapter 10: Page Replacement Algorithms