NextPreviousFirstLastIndex Heaps and Garbage Collection Alan KaminskyHome Page

3.  Allocation Algorithms

3.3.  Free List Organization

3.3.1.  Heap Data Structure

  • In-use blocks may be located anywhere in the heap

  • Free blocks may be located anywhere in the heap

  • Free blocks linked together into a free list

  • Pros
    • Can use a non-compacting garbage collection algorithm (faster)
    • That is, in-use blocks do not have to be shifted and pointers do not have to be adjusted during garbage collection

  • Cons
    • More complicated and slower allocation algorithm
    • Free space subject to fragmentation
    • In the figure, you can't allocate a 10-word block, even though there are 10 total free words

NextPreviousFirstLastIndex Heaps and Garbage Collection Alan KaminskyHome Page
Copyright © 2001 Rochester Institute of Technology. All rights reserved. Last updated 06-Dec-2001. Please send comments to ark­@­cs.rit.edu.