The primary purpose of an automatic storage-reclamation system for digital computers is to reclaim the memory occupied by memory objects that are no longer necessary for the correct operation of the computer programs that are clients of the reclamation system. Clients typically refer to computer programs that utilize the storage-reclamation system. Objects refer to client data associated with a portion of the computer memory.
A storage-reclamation system is thus a process of reclaiming the memory locations occupied by garbage objects, or garbage, the term commonly used to refer to those memory objects that are no longer necessary. The act of reclaiming such memory objects is commonly called garbage collection, and a garbage collector is a process by which an automatic storage-reclamation system actually reclaims the memory occupied by memory objects that have become garbage.
An automatic storage-reclamation system is capable of reclaiming such memory without explicit instructions from the programs that formerly utilized these objects. Frequently, however, some final action or sequence of actions needs to be taken when a memory object becomes a garbage object, beyond simply reclaiming the memory occupied by such memory objects. Finalization is the sequence of actions that should be performed once a memory object has become garbage. For example, a garbage object may refer to an external resource that is managed by another subsystem. Further, this external subsystem may expect its clients to issue explicit confirmation that they no longer need the external resource, thus making it possible for the external resource to be recycled. Examples of such external resources are the file-system objects managed by the computer's operating system and the various resources utilized by the computer's window-management subsystem.