Internal Fragmentation
- In fixed partitioning, the various partitions can be of same size or different size.
- Whenever a new process arrives & needs memory, it is allocated a partition large enough to hold the process.
- However, the size of partition may be larger than the size of the process. In such a case part of memory partition goes waste and remains unused. Such as unused space is called fragment.
- Thus, the allocation of a process to a partition greater than the process’s requirement results in the wastage of space internal to a partition. This is known as internal fragmentation.
- It is called internal fragmentation because the memory is wasted within the space allocated to process i.e. internal to a partition.
- For Example, The memory consists of three partitions of size 200k, 300k and 400k respectively. These partitions are occupied by 3 processes A, B and C of size 150k, 200k and 300k respectively. The allocation of these 3 processes to the partitions results in the wastages of 50k, 100k and 100k in partitions 1, 2 and 3 respectively.
External Fragmentation
- In variable partition allocation, each process is allocated exactly the same amount of memory it requires.
- In such a way processes after finishing their execution leave the memory and some new processes are loaded in the same space.
- As the memory requirement of different processes is not same, the swapping of different processes results in the formation of unusable memory holes. This is known as external fragmentation.
- It is called external fragmentation as the memory space is wasted external to the allocated memory partitions.
Comparison between Internal fragmentation and External fragmentation
Internal Fragmentation | External Fragmentation |
It is the wastages of memory space that is within (inside) the partition allocated to a process. | It is the wastage of memory space that is outside the partitions allocated to processes. |
It occurs when process is allocated partition greater than its requirement. | Such a fragmentation occurs when process is allocated exactly the same memory space as it requires. |
This type of fragmentation occurs when we implement multiple fixed partition method and paging. | This type of fragmentation occurs in multiple variable partition method and segmentation. |
Internal fragmentation results in the duction of number of frame that are available. | External fragmentation results in the reduction of amount of usable memory. |
Diagrammatically internal fragmentation is represented as: |
Diagrammatically external fragmentation is represented as: |