Operating Systems
Unit 7: Memory Management
From logical addresses to page replacement algorithms — master memory management with complete numerical walkthroughs, frame-by-frame tables, and real-world Indian case studies.
⏱️ Time to Complete: 8 hrs theory + 6 hrs lab | 💰 Earning Potential: ₹8K–₹25K/month | 📝 30 MCQs (Bloom's Mapped)
💼 Jobs this unlocks: Systems Engineer (₹6–12 LPA) | Performance Engineer (₹8–18 LPA)
Opening Hook — When India's Vaccine Booking Crashed
🏥 Could Better Memory Management Have Saved CoWIN?
May 2021. India opened COVID-19 vaccination for 18+ year-olds. Over 25 million users hit CoWIN simultaneously. The servers didn't crash from slow CPUs or bad code — they crashed because too many processes needed memory at the same time. The system ran out of physical frames, processes started swapping pages in and out frantically, and thrashing began. CPU utilisation dropped to nearly 0% because every process was waiting for its pages to be loaded from disk.
The result? India's vaccine booking went completely offline for hours. Appointment slots disappeared. People panicked. The government had to add 100+ servers and implement rate limiting — but the root problem was memory management.
What if the system had better page replacement algorithms? What if virtual memory was configured with the right working-set window? What if the OS had detected thrashing and responded before collapse? These aren't hypothetical questions — they're exactly what this chapter teaches you to answer.
Learning Outcomes — Bloom's Taxonomy Mapped
| Bloom's Level | Learning Outcome |
|---|---|
| 🔵 Remember | Define logical address, physical address, page fault, TLB, thrashing, and list page replacement algorithms |
| 🔵 Understand | Explain how MMU translates logical to physical addresses; differentiate internal vs external fragmentation |
| 🟢 Apply | Solve address translation problems — given a logical address, page size, and page table, compute the physical address |
| 🟢 Analyze | Trace FIFO, LRU, and Optimal page replacement algorithms with reference strings and count page faults step-by-step |
| 🟠 Evaluate | Compare FIFO vs LRU vs Optimal and justify which algorithm is best for a given workload; explain Belady's Anomaly |
| 🟠 Create | Build a Python page replacement simulator and propose memory optimisation strategies for Indian-scale systems |