garbage collection

Also found in: Dictionary, Thesaurus, Medical, Legal, Financial, Acronyms, Wikipedia.

garbage collection

[′gär·bij kə‚lek·shən]
(computer science)
In a computer program with dynamic storage allocation, the automatic process of identifying those memory cells whose contents are no longer useful for the computation in progress and then making them available for some other use.

garbage collection

(GC) The process by which dynamically allocated storage is reclaimed during the execution of a program. The term usually refers to automatic periodic storage reclamation by the garbage collector (part of the run-time system), as opposed to explicit code to free specific blocks of memory.

Automatic garbage collection is usually triggered during memory allocation when the amount free memory falls below some threshold or after a certain number of allocations. Normal execution is suspended and the garbage collector is run. There are many variations on this basic scheme.

Languages like Lisp represent expressions as graphs built from cells which contain pointers and data. These languages use automatic dynamic storage allocation to build expressions. During the evaluation of an expression it is necessary to reclaim space which is used by subexpressions but which is no longer pointed to by anything. This reclaimed memory is returned to the free memory pool for subsequent reallocation.

Without garbage collection the program's memory requirements would increase monotonically throughout execution, possibly exceeding system limits on virtual memory size.

The three main methods are mark-sweep garbage collection, reference counting and copying garbage collection.

See also the AI koan about garbage collection.

garbage collection

(1) In a flash memory-based solid state drive (SSD), the garbage collection function improves write speed by erasing blocks of unused storage in the background, because flash memory requires blocks to be erased before they can be written. Having empty blocks available saves time when writing new data on the drive. See TRIM support and solid state drive.

(2) A software routine that searches memory for areas of inactive data and instructions in order to reclaim that space for the general memory pool (the heap). Operating systems may or may not provide this feature. For example, Windows does not do automatic garbage collection which requires that the programmer specifically deallocates memory in order to release it.

Move It to Disk or Deallocate
If a program continues to allocate memory for data buffers and eventually exceeds the physical memory capacity, the operating system then has to place parts of the program in virtual memory (on disk) in order to continue, which slows down processing. Writing the code to deallocate memory after a routine no longer needs it is a tedious task that programmers often forget to do. Java performs automatic garbage collection without programmer intervention, which eliminates this coding headache. See dynamic memory allocation, heap and Java.
References in periodicals archive ?
The government also announces that temporary landfills have been identified and garbage collection has resumed.
This was the second time in less than a week that garbage collection vehicles trucks belonging to Yatta were seized.
Williams further noted that garbage collection in Android is ideal if the Android apps have four up to eight times more than the memory required to proceed to garbage collection.
Iatrou said that he cannot take municipal workers from other services for garbage collection and leave them short staffed, but even if he did, it would still be more costly.
Bahrain needs to adopt a modern garbage collection system and move away from open skips, which are smelly, unhealthy and attract all manner of vermin and stray animals.
The following series - SATA25000, SATA Slim J200, InnoRobust II, Evergreen - incorporate Garbage Collection with TRIM.
The new Kingston SSDNow V+100 also has an enhanced 'always-on' garbage collection feature, which cleanses redundant data from the drive to prevent performance degradation and maintains the drive over its life cycle.
Currently the cleaning and garbage collection, a survey on the seismic stability of all the houses, on the suitability of structural elements, masonry of walls of 6 houses, import and distribution of 125 tons of the foundation, pour of the foundation of 12 houses, construction of a multistory house panel, sign of 130 contracts for a loan, per-house check to link the project of homes, development of projects to 210 homes are underway.
com)-- New concurrent garbage collection technology improves utilization of embedded multiprocessor/multi-core systems at peak performance.
now introduces eco-friendly garbage collection with its all-new battery-powered trash compactor utilizing the power supply system developed for Mitsubishi Motors' i-MiEV in its garbage collection trucks.
The surcharge would ensure that garbage collection services reflect their true cost, which includes wear and tear on the city's transportation system.
AMMAN (Star)--Ms Hanan Kurdi is the first Jordanian woman to drive a garbage collection truck in Amman.