Internal fragmentation is wasted memory inside an allocated block: the allocator hands a process a fixed block bigger than it asked for, so the leftover space sits unused. External fragmentation is wasted memory between blocks: enough total memory is free, yet it is split into small non-contiguous holes, so a large request still fails. In short, internal waste hides inside a block, while external waste scatters across the gaps.
Internal and external fragmentation are the two ways an operating system wastes memory while it allocates blocks to processes. Both appear in every operating-systems and GATE syllabus. Students often blur where the waste actually sits and which fix removes it.
The core question is simple. Is the unused space stuck inside one block, or scattered between many blocks? Internal fragmentation is the first case, while external fragmentation is the second. This guide defines each type, compares them in detail, and shows how the OS fixes each one.
If you are still mapping out the basics, it helps to know the difference between paging and segmentation first, since each one causes a different kind of fragmentation.

What is Internal Fragmentation?
Internal fragmentation is the memory wasted inside an allocated block. The allocator gives a process a fixed-size block that is larger than it requested, so the leftover space inside that block stays idle. Because the block already belongs to one process, no other process can use that gap.
This happens whenever memory is split into fixed-size partitions. It also happens with paging, since the last page of a process is usually only partly filled. For example, a process needs 6 KB but receives an 8 KB block, so 2 KB sit wasted inside it. As a result, the waste is small per block, yet it adds up across many allocations.
Advantages of fixed-size allocation (which causes internal fragmentation):
- Simple to manage, because every block is the same known size.
- Fast allocation, since the OS just picks the next free slot.
- No external fragmentation, so any free block fits any request.
Disadvantages of internal fragmentation:
- Wasted space inside each block that no other process can reach.
- Lower effective memory use, because the gaps pile up over time.
- Larger blocks make the waste worse, so sizing matters a lot.
What is External Fragmentation?
External fragmentation is the memory wasted between allocated blocks. Enough total memory is free, yet it is split into many small non-contiguous holes scattered across the address space. So a large contiguous request can fail even though the total free bytes would cover it.
This happens whenever memory is split into variable-size partitions. It also happens with segmentation, since segments differ in size and leave odd gaps as they come and go. For example, 6 KB is free overall, but it is split into a 2 KB hole here and a 4 KB hole there, so a 6 KB process still cannot load. In contrast to internal waste, this gap is usable in theory, just not as one piece.
Advantages of variable-size allocation (which causes external fragmentation):
- No internal waste, because each block matches the exact request.
- Flexible sizing, so memory fits processes of any size.
- Better use per block, since nothing is over-allocated.
Disadvantages of external fragmentation:
- Free memory scatters into holes, so large requests can fail.
- Allocation slows down, because the OS hunts for a fitting hole.
- Compaction may be needed, which costs time to relocate blocks.
Internal vs External Fragmentation: Comparison Table

| Aspect | Internal Fragmentation | External Fragmentation |
|---|---|---|
| Definition | A process is allocated more memory than it needs, so unused space is left inside the block | Free memory exists but in a non-contiguous manner, so the system fails to allocate a contiguous block |
| Where the waste sits | Inside an allocated block | Between allocated blocks |
| Partition type | Occurs with fixed-size partitions | Occurs with variable-size partitions |
| Cause | Block size is larger than the request | Free space is split into small scattered holes |
| Can others use the gap? | No, the gap belongs to one process | Yes in theory, but not as one contiguous piece |
| Total free memory | May be low overall | Can be high, yet still unusable as a block |
| Linked to paging? | Yes, the last page is usually partly filled | No, paging removes external fragmentation |
| Linked to segmentation? | No, segments match the exact size | Yes, variable segments leave gaps |
| Main solution | Allocate memory dynamically; use smaller or variable blocks | Paging, compaction, or segmentation reorganisation |
| Compaction help | Does not help | Merges scattered holes into one block |
| Allocation speed | Fast, since slots are uniform | Slower, since the OS searches for a fitting hole |
| Block size effect | Bigger blocks waste more | Smaller blocks scatter more holes |
| Typical scheme | Fixed partitioning and paging | Dynamic partitioning and segmentation |
| Example | A process needs 6 KB but gets an 8 KB block, so 2 KB is wasted inside | 6 KB is free in total, but split into holes, so a 6 KB process cannot load |
| Severity over time | Steady small waste per block | Grows as processes load and exit |
How Each Fragmentation Happens
The clearest way to see the gap is one small picture of memory. Suppose the OS manages a strip of RAM and loads a few processes into it.
With internal fragmentation, the OS uses fixed 8 KB blocks. A process asks for 6 KB, yet it still gets a full 8 KB block. So 2 KB sits unused inside that block, and no other process can claim it. Multiply that by many processes, and the lost memory grows quietly.
With external fragmentation, the OS uses variable blocks that match each request. Over time, processes load and exit, so they leave gaps of 2 KB here and 4 KB there. Now 6 KB is free overall, but it is non-contiguous. As a result, a new 6 KB process cannot load, because no single hole is large enough.
So both schemes lose memory, yet for opposite reasons. Internal fragmentation wastes space inside a block, while external fragmentation wastes space between blocks. That single contrast answers most exam questions on the topic.
Paging vs Segmentation: A Key Contrast

The two memory schemes map neatly onto the two kinds of waste. So this contrast is a favourite in interviews and GATE papers.
Pure paging has internal fragmentation but no external fragmentation. Every page and frame is the same fixed size, so any free frame fits any page. However, the last page of a process is usually only partly filled, which wastes a little space inside it.
Pure segmentation has external fragmentation but no internal fragmentation. Each segment matches its exact size, so nothing is wasted inside. Yet segments differ in length, so they leave scattered gaps between them as processes come and go.
In short, paging trades external waste for a little internal waste, while segmentation does the reverse. To learn the full picture, see the dedicated guide on paging vs segmentation.
How to Fix Each One
You fix each kind of fragmentation differently, because the waste sits in a different place. So matching the fix to the cause matters.
For internal fragmentation, allocate memory more closely to the request. Dynamic allocation with variable or smaller block sizes cuts the leftover gap inside each block. A smaller page size also helps in paging, yet it comes with a trade-off: smaller pages mean a bigger page table to track them all.
For external fragmentation, merge or sidestep the scattered holes. Compaction relocates the allocated blocks together so the free holes combine into one usable block. Paging avoids the problem entirely, since any free frame works and contiguity is no longer required. Tools and monitoring help, yet the real cure is the right allocation scheme.
Interview Questions
Frequently Asked Questions
Wrapping Up
Internal and external fragmentation waste memory from opposite directions. Internal fragmentation hides unused space inside an allocated block, while external fragmentation scatters free space into holes between blocks.
Remember the simple rule: internal waste sits inside a block, and external waste sits between blocks. Fixed partitions and paging cause internal fragmentation, while variable partitions and segmentation cause external fragmentation. Fix internal waste with tighter block sizes, and fix external waste with compaction or paging. That contrast is enough to answer most exam and interview questions on the two.
Related reading on DiffStudy: