If I had a heap like the following: with blue blocks being occupied memory and white blocks being free memory

enter image description here

What is the general name given to the situation illustrated, where the free and occupied cells become distributed almost 'randomly'?

This is an exam question, I've tried searching online and through the provided slides but to no avail.

  • 3
    $\begingroup$ Fragmentation, perhaps? $\endgroup$ – chbaker0 Jun 8 '14 at 14:59
  • $\begingroup$ @mebob That is what I initially thought but wanted to get others answers. $\endgroup$ – CS Student Jun 8 '14 at 18:40

This is fragmentation. See https://en.wikipedia.org/wiki/Fragmentation_%28computing%29 for a definition. Fragmentation can happy on any kind of storage; most commonly it is discussed for persistent storage (e.g., in filesystems), but heap fragmentation can also happen, and that is what you are describing. See also https://en.wikipedia.org/wiki/Memory_management (which discusses heap fragmentation).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.