External fragmentation
As processes start and end, their code and data is swapped in and out of main memory. Thiss wapping can lead to external fragmentation: small portions of memory are free, but not contiguous. This is an issue as segmentation requires processes to be stored in contiguous segments.
Fragmentation can lead to situations in which there is enough free memory for a process to be swapped in but it can’t as the free memory is not contiguous.
title: Example of external fragmentation
Defragmentation
As fragmentation increases, it may become necessary to for the memory to be defragmented. Defragmenting is a process that moves memory around so that free memory is in a continous block, but it may be computationally expensive.