operating-systems

Definition

Fragmentation

Fragmentation is a phenomenon in which memory becomes unusable because it is divided into small, non-contiguous pieces.

Types of Fragmentation

Internal Fragmentation

Internal fragmentation occurs when memory is allocated in fixed-size blocks (partitions). If a process is smaller than the allocated block, the remaining space within that block is wasted.

External Fragmentation

External fragmentation occurs when free memory is scattered throughout the system in small, non-contiguous blocks between allocated partitions. While the total amount of free memory might be sufficient for a request, no single block is large enough.

  • Occurrence: Most common in Dynamic Partitioning and Segmentation.
  • Solution: Compaction (shuffling memory to join holes) or using non-contiguous allocation methods like paging.