OPERATING SYSTEM NOTES
Completion requirements
3. MEMORY MANAGEMENT
Memory management is a key function of the Operating System (OS) that controls how main memory (RAM) is used by processes. It decides:
-
Which process gets how much memory
-
When a process gets memory
-
When memory is freed and reused
Key Responsibilities of Memory Management:
🔢 | Function | Explanation |
---|---|---|
1️⃣ | Tracks memory usage | Keeps record of each memory block — whether allocated or free. |
2️⃣ | Allocates memory | Gives memory to processes when they need it. |
3️⃣ | Manages swapping | Moves processes in and out of memory to/from disk during execution. |
4️⃣ | Deallocates memory | Frees up memory when a process finishes or no longer needs it. |
5️⃣ | Prevents conflicts | Ensures one process doesn't use memory assigned to another (memory protection). |
Why Memory Management Is Important:
-
Ensures efficient use of memory.
-
Supports multitasking by managing multiple processes.
-
Helps avoid crashes or corruption due to memory conflicts.
-
Balances speed vs. space (RAM is fast but limited; disk is slow but large).