1. Introduction
When memory is allocated to processes, it is not always perfectly utilized. Sometimes, a portion of allocated memory remains unused inside the allocated block itself.
This wasted space is called Internal Fragmentation.
Internal fragmentation is a direct consequence of fixed-size memory allocation strategies and plays an important role in determining memory efficiency.
2. What is Internal Fragmentation?
Internal Fragmentation occurs when the allocated memory block is larger than the requested memory, leaving unused space within the allocated region.
Key Idea
Allocated Block > Requested Memory
Unused Space Inside Allocated Block
= Internal Fragmentation
The unused memory lies inside the allocated partition and cannot be used by other processes.
3. Example of Internal Fragmentation
Suppose:
Partition Size = 100 KB
Process Size = 70 KB
Memory Allocation:
+----------------------+
| Process 70 KB |
| Unused 30 KB |
+----------------------+
Unused Memory:
100 KB - 70 KB = 30 KB
Therefore:
Internal Fragmentation = 30 KB
4. Where Does Internal Fragmentation Occur?
4.1 Fixed Partition Allocation
Memory is divided into fixed-size partitions.
A process may not completely utilize the partition assigned to it.
Example
Partition Size = 256 KB
Process Size = 180 KB
Unused Space:
76 KB
This unused space becomes internal fragmentation.
4.2 Paging (Important)
Paging uses fixed-size pages and frames.
The last page of a process may not be completely filled.
Example
Page Size = 4 KB
Process Size = 18 KB
Required Pages:
18/4 = 4.5
Therefore:
5 pages needed
Allocated Memory:
5 × 4 KB = 20 KB
Unused Memory:
20 KB - 18 KB = 2 KB
This 2 KB is internal fragmentation.
5. Why Internal Fragmentation Occurs
Internal fragmentation occurs because memory is allocated in fixed-size units.
The requested memory size rarely matches the allocated block size exactly.
Key Insight
Internal fragmentation is caused by over-allocation.
Allocated Memory > Required Memory
The difference becomes wasted space.
6. Characteristics of Internal Fragmentation
Occurs inside allocated memory blocks
Memory is reserved but unused
Cannot be allocated to other processes
Common in fixed-size allocation schemes
Hidden form of memory wastage
7. Mathematical Representation
Formula
Example
Allocated Memory = 128 KB
Requested Memory = 100 KB
Calculation:
Internal Fragmentation = 128 - 100
= 28 KB
8. Impact on System Performance
8.1 Memory Wastage
Part of RAM remains allocated but unused.
This reduces effective memory utilization.
8.2 Reduced Multiprogramming
Fewer processes can fit into memory.
Available memory decreases unnecessarily.
8.3 Lower Throughput
Memory shortages may prevent new processes from being loaded.
System throughput may decrease.
8.4 Increased Memory Cost
More physical memory may be required to support the same workload.
9. Advantages (Indirect Benefits)
Although fragmentation itself is undesirable, it arises from techniques that offer certain benefits.
Simple Memory Management
Fixed-size partitions are easy to manage.
Fast Allocation
Memory allocation and deallocation are very quick.
Low Management Overhead
The operating system performs fewer calculations during allocation.
10. Disadvantages
Memory Waste
Unused memory remains locked inside partitions.
Poor Utilization
Available RAM is not fully exploited.
Difficult to Recover
The wasted space cannot be reassigned while the process is running.
Scalability Issues
Becomes significant when many processes are loaded.
11. How to Reduce Internal Fragmentation
11.1 Variable-Sized Allocation
Allocate memory according to actual process requirements.
This minimizes unused space.
11.2 Smaller Allocation Units
Smaller page or partition sizes reduce average wasted memory.
Example
Page Size = 1 KB
Produces less waste than:
Page Size = 8 KB
11.3 Segmentation
Memory is allocated according to logical program components.
This can reduce internal fragmentation.
11.4 Better Allocation Policies
More sophisticated allocation techniques can reduce wasted memory.
12. Internal vs External Fragmentation
| Feature | Internal Fragmentation | External Fragmentation |
|---|---|---|
| Location | Inside allocated block | Between allocated blocks |
| Cause | Fixed-size allocation | Variable-size allocation |
| Memory Status | Allocated but unused | Free but scattered |
| Visibility | Hidden | Visible |
| Solution | Smaller blocks/pages | Compaction, Paging |
Example
Internal Fragmentation
[ Process ][ Unused ]
Unused space exists inside the allocated partition.
External Fragmentation
[ Process ][ Free ][ Process ][ Free ]
Free memory exists but is scattered.
13. Internal Fragmentation in Paging (Exam Favorite)
Paging eliminates external fragmentation but introduces internal fragmentation.
Why?
Because the last page of a process is rarely filled completely.
Example
Page Size = 4 KB
Process Size = 10 KB
Pages Required:
3 Pages = 12 KB
Unused Memory:
12 KB - 10 KB = 2 KB
Internal Fragmentation:
2 KB
Important Exam Point
Paging removes external fragmentation but may still suffer from internal fragmentation.
14. Real-World Analogy
Imagine booking a conference hall.
Hall Capacity = 100 Seats
People Attending = 70
Unused Seats:
30 Seats
Although those seats are empty, they remain reserved and cannot be used by another group.
This unused reserved space is exactly like Internal Fragmentation.
Most Important Point
Internal Fragmentation is wasted space inside allocated memory blocks caused by allocating more memory than a process actually requires.