Fixed Partitioning

Fixed partitioning is also known as Static partitioning. It is the earliest (1960) technique, in which main memory is divided into equal or different sizes of partitions. OS resides in the first partition, and other processes reside in other partitions of main memory.

It is a very simple form of contiguous memory allocation and is very easy to implement. Fixed partitions is of two types,

1. Equal size partitions
2. Unequal Size Partitions

   Consider a main memory size of 30MB.

fixed size partitions equal-unequal

1. Equal-sized Fixed Partition

Consider a First Fit Algorithm for Memory Allocation in equal-sized fixed partition. Let’s suppose the main memory has five partitions with each size 6MB and five incoming processes (P1 to P5) with sizes 2MB, 6MB, 3MB, 4MB, and 6MB, respectively.

fixed partitioning (equal)
  • Internal fragmentation

Internal fragmentation for Partition 1 = size of partition - size of process = 6 - 2 = 4MB
Internal fragmentation for Partition 2 = size of partition - size of process = 6 - 6 = 0MB
Internal fragmentation for Partition 3 = size of partition - size of process = 6 - 3 = 3MB
Internal fragmentation for Partition 4 = size of partition - size of process = 6 - 4 = 2MB
Internal fragmentation for Partition 5 = size of partition - size of process = 6 - 6 = 0MB

  • External fragmentation

External fragmentation = Total sum of internal fragmentation = 4+0+3+2+0 = 9MB

2. Unequal Fixed Partition

Consider a First Fit Algorithm for Memory Allocation in Unequal fixed partition. Let’s suppose the main memory has five partitions with sizes 10MB, 6MB, 4MB, 4MB, and 6MB, respectively, and five incoming processes (P1 to P5) with sizes 2MB,6MB,3MB,4MB,6MB respectively.

  • Internal fragmentation

Internal fragmentation for Partition 1 = size of partition - size of process = 10 - 2 = 8MB
Internal fragmentation for Partition 2 = size of partition - size of process = 6 - 6 = 0MB
Internal fragmentation for Partition 3 = size of partition - size of process = 4 - 3 = 1MB
Internal fragmentation for Partition 4 = size of partition - size of process = 4 - 4 = 0MB
Internal fragmentation for Partition 5 = size of partition - size of process = 6 - 6 = 0MB

  • External fragmentation  

External fragmentation = Total sum of internal fragmentation = 8+0+1+0+0 = 9MB

Fixed Partitioning External fragmentation (Unequal)

Conditions for fixed Partitions:

1. One process cannot reside in more than one partition.

Explain: if there are two empty partitions of 10 KB and 10KB in RAM, and the incoming process size is 20 KB, then the Main memory can’t accommodate it.

2. Only one process in one partition because more than one process cannot load in one partition.

Explain: At the time when P7 arrives, each partition contains one process. So, P7 cannot load even 3MB space is available in the form of internal fragmentation.

Fix partition conditions

Conclusion: Each partition in RAM can accommodate only one process. That’s why if there are 50 partitions in RAM, only 50 processes can come into RAM.

Note: If the process size is greater than the partition size, then that process cannot be loaded into the main memory.

Drawbacks of Fixed Partitions:

 1. Internal Fragmentation

If the process size is less than the total size of the partition, then the extra size of the partition is wasted. This wastage of memory is internal fragmentation.

As shown in the image above, the 4 MB in partition 2 is unused, the 3 MB in partition 3 is unused, 6 MB is unused in partition 4, and 5 MB is unused in partition 5. Then, These 4MB, 3MB, 6MB, and 5MB in partitions 2, 3, 4, and 5, respectively, are internal fragmentation.

2. External Fragmentation

The total unused space of various partitions is external fragmentation. It cannot load the processes even though there is space available due to internal fragmentation.

As shown in the image above, the 4 MB in partition 2 is unused, the 3 MB in partition 3 is unused, 6 MB is unused in partition 4, and 5 MB is unused in partition 5. Therefore, the total 18MB of unused space from different partitions is the external fragmentation.

3. Limitation on the size of the process

If the process size is greater than the size of the maximum-sized partition, then that process cannot be loaded into the memory.

4. The degree of multi-programming is less

In fixed partitioning, the degree of multi-programming is fixed and very low. So, the Degree of multi-programming does not increase even if the process is too small.