Garbage collection is the automatic reclamation of computer storage.
The garbage collectors function is to find data objects that are no longer in use and make their space available for reuse by the running program. An object is considered garbage if is not reachable by the funning program via any path of pointer traversals. 3 Motivation Garbage collection is necessary for fully modular programming, to avoid introducing unnecessary inter-module dependencies. Since liveness is a global property, this introduces nonlocal bookkeeping into routines that might otherwise be locally understandable and flexibly composable. This bookkeeping inhibits abstraction and reduces extensibility, because when new functionality is implemented, the bookkeeping code must be updated.