memory-managementmemory-fragmentation

Solution to external fragmentation in contiguous memory allocation


In contiguous memory allocation we have a problem of external fragmentation , but cant we just combine all the available small holes of free memory to create a big one according to our requirement?


Solution

  • Yes we can combine all the memory space which is scattered all over the physical memory and is not contiguous. So we need an algorithm to move all the used memory allocations to one side of the memory so that we a contiguous free memory available. This method is called Compaction. Compaction is quite inefficient to execute and require some time. Also the memory bound dynamically can be reallocated.