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)

Section A

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.

🇮🇳 CoWIN🇮🇳 IRCTC🇮🇳 Aadhaar🇮🇳 UPI/NPCI🇮🇳 Paytm🇮🇳 Qualcomm India
Your smartphone with 4GB RAM runs 50+ apps using virtual memory. Android's Low Memory Killer (LMK) is a page replacement system that decides which app to evict from memory when RAM is full. On budget phones like Redmi and Realme (₹8,000–₹12,000 range), LMK fires hundreds of times daily — that's why your apps reload when you switch back. Memory management is happening right now in your pocket.
Section B

Learning Outcomes — Bloom's Taxonomy Mapped

Bloom's LevelLearning Outcome
🔵 RememberDefine logical address, physical address, page fault, TLB, thrashing, and list page replacement algorithms
🔵 UnderstandExplain how MMU translates logical to physical addresses; differentiate internal vs external fragmentation
🟢 ApplySolve address translation problems — given a logical address, page size, and page table, compute the physical address
🟢 AnalyzeTrace FIFO, LRU, and Optimal page replacement algorithms with reference strings and count page faults step-by-step
🟠 EvaluateCompare FIFO vs LRU vs Optimal and justify which algorithm is best for a given workload; explain Belady's Anomaly
🟠 CreateBuild a Python page replacement simulator and propose memory optimisation strategies for Indian-scale systems