Header Ads Widget

Fixed (or static) Partitioning in Operating System

Memory Management
The memory management can be done in two ways namely, contiguous and non-contiguous as shown in the figure.
Memory Management Techniques

Fixed Partitioning

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

It is a very simplest form of contiguous memory allocation and 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 suppose, Main memory has five partitions with each size 6MB and five incoming processes (P1 to P5) with sizes 2MB, 6MB, 3MB, 4MB, 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 sized fixed partition. Let suppose, Main memory has five partitions with sizes 10MB, 6MB, 4MB, 4MB, 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 incoming process size is 20 KB then 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 arrive, 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 then only 50 processes can come in RAM.

Note: if the process size is greater than partition size then that process cannot load into main memory.

Drawbacks of Fixed Partitions:

 1. Internal Fragmentation

If process size is less than the total size of partition then extra size of 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 in partition 4 is unused and 5 MB in partition 5 is unused. Then This 4MB, 3MB, 6MB and 5MB in partition 2, 3, 4, and 5 respectively is 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 in partition 4 is unused and 5 MB in partition 5 is unused. Therefore, the total 18MB 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 maximum sized partition then that process could not be loaded into the memory.

4. Degree of multi-programming is less

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

Post a Comment

0 Comments