November 2019
Intermediate to advanced
404 pages
12h 9m
English
Fragmentation occurs when objects of different sizes are allocated and deallocated in alternating orders and if lots of small objects are deallocated, following by lots of large objects being allocated.
This is best explained through an example. The following shows four steps we take in allocating and deallocating memory in a typical heap memory space:

The memory allocation takes place as follows:
Read now
Unlock full access