1.) Fixed-Partition Strategy
The Fixed-Partition strategy divides memory into a predefined number of fixed-size partitions or blocks at system startup. Each partition can hold one process, and each partition’s size remains constant throughout system operation.
Characteristics
- Fixed Size: Partitions are allocated at fixed sizes regardless of the actual memory requirements of processes.
- Limited Flexibility: Processes are constrained to fit within available fixed-size partitions, which may result in unused memory.
- Static Allocation: Once partition sizes are set, they cannot be altered without restarting or reconfiguring the system.
Advantages
- Simplicity: Easy to implement since memory is statically divided at startup, with no need for dynamic allocation.
- Low Overhead: Since partitions are predefined, memory management requires minimal processing, leading to lower CPU overhead.
- Fast Process Loading: The OS can quickly assign available partitions to incoming processes without complex calculations.
Disadvantages
- Internal Fragmentation: If a process requires less memory than a partition’s fixed size, the unused memory within that partition remains idle, leading to internal fragmentation.
- Limited Process Size: Large processes that require more memory than any partition’s fixed size cannot be accommodated, leading to resource wastage.
- Inefficient Memory Use: Unused memory space within partitions results in inefficient memory utilization.
Example
Suppose a system has 1 GB of RAM divided into four fixed partitions of 256 MB each. If a process requires only 100 MB of memory, it will still occupy a full 256 MB partition, leading to unused memory within that partition.
2.) Variable-Partition Strategy
The Variable-Partition strategy dynamically allocates memory partitions based on the exact memory requirements of processes. Partitions are created as needed and can vary in size, which allows for more flexible memory use.
Characteristics
- Dynamic Size: Partitions are created to match the memory requirements of each process, reducing memory wastage.
- Flexible Allocation: Partitions can grow or shrink as processes are loaded and terminated, optimizing memory usage.
- Higher Complexity: Managing dynamic partitions requires additional tracking to keep track of free and occupied memory segments.
Advantages
- Reduced Internal Fragmentation: Since partitions are created to match process size requirements, there is less unused space within partitions.
- Efficient Memory Utilization: The memory allocated better fits process requirements, reducing wastage.
- No Size Constraint: Large processes that require substantial memory can be accommodated as long as there is sufficient free memory.
Disadvantages
- External Fragmentation: Over time, free memory may be broken into small, non-contiguous blocks, making it difficult to allocate memory to new processes.
- Complex Management: Managing and tracking variable-sized partitions requires complex algorithms and additional processing.
- Increased Overhead: Dynamic allocation and deallocation of memory partitions involve more overhead, leading to higher CPU utilization.
Example
In a variable-partition system with 1 GB of RAM, if a process requires 100 MB, the OS creates a 100 MB partition for it. When the process finishes, its 100 MB partition is released back to free memory, which can be used for other processes.