Internal vs. External Fragmentation (6 marks)

Aspect Internal Fragmentation External Fragmentation
Definition Wasted space inside an allocated fixed‐size block when the process doesn’t fill it completely. Wasted space between allocated blocks: free memory breaks into small non-contiguous holes.
Cause Rounding up a process’s memory request to the next whole partition/page size. Dynamic allocate/deallocate of variable-sized chunks leaves scattered holes over time.
Location of Waste Within the boundaries of an allocated page or fixed partition. Between allocated regions in the free memory pool.
Example A process needs 18 KB on a system with 4 KB pages ⇒ it gets 5 pages (20 KB), leaving 2 KB unused in the last page. After freeing blocks of 100 KB, 150 KB, and 400 KB, a 350 KB request fails—no single hole ≥ 350 KB even though total free = 650 KB.
Occurs In Fixed‐size schemes (paging, MFT). Variable‐size schemes (MVT, segmentation).
Mitigation Reduce block/page size; use variable‐sized allocation (segmentation/MVT). Compaction (costly); paging—allow noncontiguous allocation of fixed‐size frames.

Solving Fragmentation with Paging (4 marks)

  1. Eliminates External Fragmentation
  2. Limits Internal Fragmentation
  3. Simplifies Allocation & Sharing
  4. Trade-Off