Garbage-Collecting C Programs

Wednesday, October 5, 2011 - 16:30
TH 331
Hans Boehm (Research Manager - HP Labs)

Most C and C++ programs explicitly deallocate or recycle memory that is no longer needed by the program, so that memory can be reused. For programs that manipulate complex data structures this is often a major source of errors.

Languages like Java instead provide a "garbage collector", which automatically reclaims memory when it is no longer accessible. Similarly, it is also possible to automatically reclaim memory in C or C++ programs with the aid of a garbage-collecting memory allocation library. Indeed, we have been developing and maintaining such a library for about 25 years.

I will give an overview of basic garbage- collection algorithms, and then examine the refinements and compromises that are needed to support C-like languages. I'll describe some of the fundamental performance differences between garbage-collected memory allocation and new/delete
or malloc/free memory allocation.


Hans Boehm is perhaps best known as the primary author of a commonly used "conservative" garbage collection library that allows the use of a garbage collector in C and C++ programs. He has published many research papers on garbage collection, including one that was awarded the PLDI 2003 Most Influential Paper Award. Since then, largely as a result of his experience with parallel garbage collection, he has played a leading role in better understanding and defining the meaning of shared variables in modern programming languages supporting threads.

Hans has a Ph.D. from Cornell University, has taught at the University of Washington and Rice University and, after working at Xerox PARC and SGI, is now a research manager at HP Labs. He is a former Chair of ACM SIGPLAN, an ACM Distinguished Scientist, and the recipient of the SIGPLAN
2006 Distinguished Service Award.