Garbage Collection (computer Science)

Garbage Collection (computer Science)

In computer science, garbage collection (GC) is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program. Garbage collection was invented by John McCarthy around 1959 to solve problems in Lisp.

Garbage collection is often portrayed as the opposite of manual memory management, which requires the programmer to specify which objects to deallocate and return to the memory system. However, many systems use a combination of approaches, including other techniques such as stack allocation and region inference.

Resources other than memory, such as network sockets, database handles, user interaction windows, and file and device descriptors, are not typically handled by garbage collection. Methods used to manage such resources, particularly destructors, may suffice to manage memory as well, leaving no need for GC. Some GC systems allow such other resources to be associated with a region of memory that, when collected, causes the other resource to be reclaimed; this is called finalization. Finalization may introduce complications limiting its usability, such as intolerable latency between disuse and reclaim of especially limited resources, or a lack of control over which thread performs the work of reclaiming.

Read more about Garbage Collection (computer Science):  Principles, Tracing Garbage Collectors, Reference Counting, Escape Analysis, Compile-time, Availability, Limited Environments

Other articles related to "garbage":

Garbage Collection (computer Science) - Limited Environments
... Garbagecollection is rarely used on embedded or real-time systems because of the perceived need for very tight control over the use of limited resources ... However,garbage collectors compatible with such limited environments have been developed ... The Microsoft NET Micro Framework and Java Platform,Micro Edition are embedded software platforms that,like their larger cousins,include garbagecollection ...

Famous quotes containing the words collection and/or garbage:

    It’s rather grisly, isnt it, how soon a living man becomes nothing more than a collection of stocks and bonds and debts and real estate?
    John Dos Passos (1896–1970)

    A mental disease has swept the planet: banalization.... Presented with the alternative of love or a garbage disposal unit, young people of all countries have chosen the garbage disposal unit.
    Ivan Chtcheglov (b. 1934)