Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53a8050

Browse files
Create README.md
1 parent b228f1f commit 53a8050

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

‎Part2/README.md‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
# 💾 Part 2 – Memory Management: Page Replacement Algorithms
3+
4+
### 📌 Operating System Design Project – Fall 2024 | University of North Texas
5+
🧑‍🏫 Instructor: Prof. Amar M. Maharjan
6+
📁 Project 5 of 6 | Focus: Page Replacement Strategy Simulation & Evaluation
7+
8+
This project simulates and evaluates five popular page replacement algorithms to understand their efficiency in managing memory pages. Each algorithm is tested using reference strings from input files and frame sizes of 10 and 20. The results are analyzed based on the number of page faults encountered during execution.
9+
10+
---
11+
12+
## 🧠 Algorithms Implemented
13+
14+
1. **FIFO (First-In First-Out)** – Replaces the oldest page in memory.
15+
2. **Optimal** – Replaces the page that will not be used for the longest future duration.
16+
3. **LRU (Least Recently Used)** – Removes the least recently accessed page.
17+
4. **LFU (Least Frequently Used)** – Evicts the page with the lowest access frequency.
18+
5. **MFU (Most Frequently Used)** – Replaces the most frequently used page, assuming it's no longer needed.
19+
20+
Each algorithm is implemented in a separate C++ source file and handles custom reference string input formats.
21+
22+
---
23+
24+
## 📂 Folder Structure
25+
26+
```
27+
Part2/
28+
├── code/
29+
│ ├── fifo.cpp
30+
│ ├── optimal.cpp
31+
│ ├── lru.cpp
32+
│ ├── lfu.cpp
33+
│ ├── mfu.cpp
34+
│ └── input/ # Reference strings for testing
35+
├── docs/
36+
│ └── Project2Report.docx
37+
└── README.md # This file
38+
```
39+
40+
---
41+
42+
## 📄 Input Format
43+
44+
Each line in the input file is a space-separated sequence of page references:
45+
46+
```
47+
7 0 1 2 0 3 0 4 2 3 0 3 2
48+
```
49+
50+
Files are grouped by test size (10-frame and 20-frame scenarios).
51+
52+
---
53+
54+
## ▶️ How to Compile and Run
55+
56+
Example for FIFO:
57+
```bash
58+
g++ fifo.cpp -o fifo
59+
./fifo input/ref10_1.txt input/ref10_2.txt ...
60+
```
61+
62+
Repeat similarly for other algorithm files.
63+
64+
---
65+
66+
## 📊 Results Summary (Page Faults)
67+
68+
| Algorithm | Avg Faults (10 Frames) | Avg Faults (20 Frames) |
69+
|-----------|------------------------|-------------------------|
70+
| FIFO | 10.2 | 25.6 |
71+
| Optimal | 9.6 | 21.8 |
72+
| LRU | 10.0 | 23.4 |
73+
| LFU | 10.4 | 23.4 |
74+
| MFU | 10.2 | 25.6 |
75+
76+
📌 **Observation:** Optimal yields the lowest page faults as expected, while LFU and LRU provide efficient real-world alternatives.
77+
78+
---
79+
80+
## 📄 Documentation
81+
82+
Comprehensive explanations, charts, and comparisons are available in the DOCX report.
83+
84+
---
85+
86+
## 🧑‍💻 Contributors
87+
88+
- Ganesh Gundekarla
89+
- Shreya Sri Bearelly
90+
- Divya Sree Dandu
91+
- Vikas Varala
92+
93+
---
94+
95+
## 📘 References
96+
97+
- Operating System Concepts, Silberschatz, Galvin & Gagne (10th Edition)
98+
- Research on Memory Hierarchies and Caching Policies

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /