Fragmentation in OS
Fragmentation
As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation.
Due to fragmentation , the system fails in allocating the contiguous memory space to a process even though it have the requested amount of memory but in a non contiguous manner.
Fragmentation occurs in a dynamic memory allocation system when many of the free blocks are to small to satisfy any requests.
Fragmentation is of two types −
S.N. | Fragmentation & Description |
---|---|
1 |
External fragmentation
Total memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous, so it cannot be used.
|
2 |
Internal fragmentation
Memory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be used by another process.
|
The following diagram shows how fragmentation can cause waste of memory and a compaction technique can be used to create more free memory out of fragmented memory −
External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic.
The internal fragmentation can be reduced by effectively assigning the smallest partition but large enough for the process.
Thank you viewers this is published by soumy Sinha ..
Comments
Post a Comment