Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The actual implementation of Objective-C’s garbage collector is more sophisticated than the simple mark and sweep garbage collector described in the previous section. It is an example of a generational garbage collector.
In most programs, allocated objects are either temporary or they last for an extended duration. A generational collector guesses that the most recently allocated memory is the memory most likely to be garbage, and examines that memory first.