home · mobile · calendar · bactac · 1999-2000 · 

BACTAC - Hirzel

Effectiveness of Garbage Collection and Explicit Deallocation
Grad Student, Computer Science

Garbage collection is the automatic reclamation of heap storage. When an object is not reachable through pointers anymore, it is declared "dead" and its memory is reclaimed. In C, you do not know exactly which values are pointers and which are not. Therefore, the garbage collector must be conservative, it must not reclaim an object if anything that looks like a pointer seems to point to it. Other than in Java or Lisp, in C explicit deallocation (via free()) is more common than the use of garbage collectors.

For our experiments, we use the Boehm/Demers/Weiser conservative garbage collector for C. We compare how much memory it reclaims to how much the explicit deallocation inserted by the programmer reclaims. We also provide the garbage collector with more accurate pointer/non-pointer information and see how much this improves its effectiveness. In most of our benchmarks, the accuracy makes no difference. For those where it does, we investigate for which memory area (stack, heap, or global) accurate information is helpful.

Department of Computer Science
University of Colorado Boulder
Boulder, CO 80309-0430 USA
May 5, 2012 (14:24)