Skip to content

Lec 19-20: Storage Allocation

Fragmentation

Internal Fragmentation

image-20240222155102467

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

image-20240222155125835

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).