Internal Fragmentation in Paging
You'll learn: How paging creates wasted space inside the last page of every process, and why this inefficiency is unavoidable.
The Problem
In paging, memory is divided into fixed-size pages (logical) and frames (physical). When a process is allocated memory, it receives whole pages—but processes rarely need memory that's an exact multiple of the page size.
This creates internal fragmentation: unused space within an allocated page that cannot be used by any other process.
How It Happens
Imagine a process needs 10.3 KB of memory, and your page size is 4 KB:
- The process gets 3 full pages (12 KB total)
- Pages 1 and 2: fully used
- Page 3: only 0.3 KB used, leaving 0.7 KB wasted
That 0.7 KB is internal fragmentation—it's allocated to the process but completely unused. No other process can access this space because pages are the smallest allocation unit.
The Analogy
Think of pages like shipping boxes of fixed size. If you ship something slightly smaller than the box, the empty space inside still travels with your package—you can't fill it with someone else's item. That wasted space is internal fragmentation.
Why It Matters
- Every process suffers internal fragmentation in its last page (on average, half a page wasted)
- Smaller page sizes → less internal fragmentation but more page table overhead
- Larger page sizes → more internal fragmentation but fewer page table entries
- This is a fundamental tradeoff in paging systems
Key Takeaway: Internal fragmentation in paging occurs because the last page of a process is rarely fully utilized, wasting the unused portion that could average up to half a page per process.