Memory Management Concepts and Techniques
Classified in Computers
Written on in English with a size of 2.78 KB
Memory Management Definition
Memory management is the process of:
- Bringing programs into the main memory to be executed by the processor.
- Dynamically dividing the part of main memory to accommodate multiple processes.
- Allocating memory efficiently for packaging processes, preventing the processor from being idle.
- Enabling the execution of a larger program than is available in real memory.
Memory Management Requirements
1. Relocation
- Ability to move a program from one region to another of the main memory without invalidating the memory references.
- The processor hardware and operating system translate the memory references' addresses to the final physical memory addresses.
2. Protection
Each process must be protected from unwanted interference from other processes, whether accidental or intentional. The hardware is responsible for checking for violations; in case of a violation, execution is aborted.
3. Sharing
Allows multiple processes to access the same area of main memory.
Advantages: Sharing a common data structure, accessing the same copy of a program without compromising the requirement for protection.
4. Logical Organization
Ability to manipulate programs and user data organized in modules.
- Memory: Sequence of bytes and words.
- Programs: Modules.
Advantages:
- Modules can be written and compiled independently.
- Sharing mechanisms can be implemented between modules.
5. Physical Organization
Organization of computer memory:
Two levels:
- Main Memory: Fast, volatile, and high cost.
- Secondary Memory: Slow, cheap, and permanent storage.
Memory Management Techniques
Memory Partitioning
a) Fixed Partitioning
Main memory is divided into a set of static partitions.
Strong Point: Simple to implement, low system overhead.
Weakness: Internal fragmentation (any program, regardless of size, occupies an entire partition in memory, leading to inefficient use of main memory).
Disadvantage: Number and size of partitions are specified at the time of system generation.
Allocation Algorithms for Fixed Partitioning
- Partitions of equal size
- Partitions of different sizes: There are two approaches:
- A queue for each partition.
- A single queue for all partitions.
b) Dynamic Partitioning
Each process is allocated a partition the same size as the process.
Strong Point: No internal fragmentation.
Weakness: Memory becomes full of holes (external fragmentation).