
206 Compilers – Principles and Practice
Reclaiming one object may therefore lead to the transitive decrementing of reference counts and
reclaiming many other objects. For example, if the only pointer into some large data structure becomes
garbage, all of the reference counts of the objects in that structure typically become zero, and all of
the objects are reclaimed.
One advantage of reference counting is the incremental nature of most of its operation – garbage
collection work, i.e. updating reference counts, is interleaved closely with the running program’s own
execution. It can easily be made completely incremental and real time, that is, ...