Interactive visualization of FIFO, LRU, Optimal, LFU and MFU page replacement algorithms.
Built with pure HTML/CSS/JS and Chart.js. Adapted from the Disk Scheduling Algorithm visualizer for OS memory management.
- 5 Algorithms: FIFO, LRU, Optimal, LFU, MFU.
- Step-by-Step Simulation: Frame state visualization, per-step table, playback controls (Play/Pause/Next/Prev).
- Metrics: Page hits, faults, hit ratio, fault ratio, frames used.
- Graphs: Page Fault Timeline (binary), Frame Utilization over steps.
- Compare All Mode: Run all algorithms instantly, view comparison bar chart and detailed table.
- Algorithm Info Cards: Collapsible cards with definition, pros/cons, time & space complexity.
- Glassmorphism UI: Consistent with the original Disk Scheduling project look and feel.
- Enter a Reference String (comma-separated integers, e.g.,
7,0,1,2,0,3,0,4,2,3,0,3,2). - Choose Number of Frames (1-10 recommended).
- Pick an Algorithm from the dropdown.
- Click Run Simulation to see frame visualization, statistics, and graphs.
- Use Play/Pause/Next/Prev to walk through the execution.
- Click Compare All to see how all five algorithms perform on the same input.
- Expand Algorithm Information cards for theoretical details.
The project follows the exact same single-file architecture as the original Disk Scheduling repository:
index.html– Main structure, controls, canvas containers.style.css– Glassmorphism styling, frame cards, tables, responsive layout.script.js– All algorithms, simulation logic, Chart.js integration, UI controllers.README.md– This documentation.
No build tools, no frameworks – just open index.html in any modern browser.
| Algorithm | Description |
|---|---|
| FIFO | First-In-First-Out: Evicts the page that was loaded earliest. |
| LRU | Least Recently Used: Evicts the page that has not been used for the longest period of time. |
| Optimal | Optimal: Evicts the page that will not be used for the longest period of time in the future. |
| LFU | Least Frequently Used: Evicts the page with the smallest reference count (used the least often). |
| MFU | Most Frequently Used: Evicts the page with the highest reference count (used the most often). |
- Empty or malformed reference strings trigger user-friendly error toasts.
- Frames must be >= 1 (and reasonably low for performance, max 20 enforced).
- Invalid characters are caught and reported.
No dependencies beyond Chart.js (loaded via CDN). To modify:
- Edit
style.cssfor visual changes. - Extend
script.jswith new algorithms (add a function and update the switch inrunAlgorithm). - Update
index.htmlto add more controls if needed.
Original concept from Disk Scheduling Algorithm Graph Plotter by Bitttu4.
This version transforms the same visual paradigm into a Page Replacement Visualizer for Operating Systems education.
MIT – free for educational and personal use.