Definition
Memory Management
Memory management is the process by which an operating system coordinates and handles computer memory, including the allocation of main memory (RAM) to processes and the movement of data between RAM and secondary storage.
Requirements
The memory management system must satisfy several key requirements:
- Partitioning: Dividing memory to accommodate multiple processes.
- Relocation: Allowing code and data to be positioned flexibly in memory, as a process’s location may change due to swapping or compaction.
- Protection: Ensuring that processes cannot access or modify the memory of other processes or the kernel without permission (see Memory Protection).
- Sharing: Allowing multiple processes to access the same physical memory frames. This is used for:
- Shared Libraries: Mapping the same library code into the virtual address spaces of different processes.
- Inter-process Communication: Allowing processes to communicate via shared memory regions.
- Performance: Minimising the overhead of address translation and management operations.
Evolution of Techniques
Memory management has evolved from simple partitioning to advanced virtual memory systems: