after using malloc() and free() too many times. the heap space becomes fragmented.
https://www.youtube.com/watch?v=gO-Ry_kxGUA
Cleaning up this fragmentation is the process of Garbage Collection.
Fragmenting in HDD occurs naturally. They can be defragmented with Windows Disk Defragmenter.
Fragmentation only causes minor performance drops.