next up previous contents
Next: Reference Up: Tutorial for Programmers Previous: The Rules

The Different Collectors

fixme: expand this. Maybe a subsection for each type of collector.

Reference counting is the fastest, but it leaks if you data has circular references. Mark-&-sweep never leaks, but it's very slow. The hybrid collector is a mark-&-sweep collector that also counts references in the hopes of saving time with cheap shots. The Boehm collector might be the only way to interface with C code that benefits from garbage collection, but it can leak. The lazy collector doesn't collect anything until the collector, itself, is destroyed, & then it deletes everything. It exists mostly for comparison purposes.



Gene Michael Stover
2002-04-28