Lec 19-20: Storage Allocation
Fragmentation
Internal Fragmentation
It is caused by - Overhead of maintaining heap data structures - Padding for alignment purposes - Explicit policy decisions (e.g., to return a big block to satisfy a small request)
External Fragmentation
Suppose no internal fragmentation
As shown in the image, there are in total 7 bytes available. But since they are not continuous, we fail to call malloc(6)
.