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.
Memory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be used by another process. The internal fragmentation can be reduced by effectively assigning the smallest partition but large enough for the process.
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. 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.
Following are the important differences between Internal Fragmentation and External Fragmentation.
|Sr. No.||Key||Internal Fragmentation||External Fragmentation|
|1||Definition||When there is a difference between required memory space vs allotted memory space, problem is termed as Internal Fragmentation.||When there are small and non-contiguous memory blocks which cannot be assigned to any process, the problem is termed as External Fragmentation.|
|2||Memory Block Size||Internal Fragmentation occurs when allotted memory blocks are of fixed size.||External Fragmentation occurs when allotted memory blocks are of varying size.|
|3||Occurrence||Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space.||External Fragmentation occurs when a process is removed from the main memory.|
|4||Solution||Best Fit Block Search is the solution for internal fragmentation.||Compaction is the solution for external fragmentation.|
|5||Process||Internal Fragmentation occurs when Paging is employed.||External Fragmentation occurs when Segmentation is employed.|