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

(programming)
(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 whole garbage collection process needs restructuring and modernising, with a state-of-the-art incineration plant and collection service.
Kingston's new SSDNow V+100 Series also enables a great 'straddling' of operating systems; its compatibility (including the garbage collection feature) with both XP and Windows 7, means that users can enjoy the immediate benefits of cost-effective performance improvements for their XP systems and/or as they move to Windows 7.
4 with support for concurrent multi-processor garbage collection technology.
The Aonix PERC Ultra Java VM, for example, performs garbage collection in real time.
Adding to the cost of trash pick-up could also induce some people to drop their garbage collection service, resulting in increased roadside dumping and other nuisances.
According to the company, PERC Ultra SMP garbage collection will reclaim all dead memory, defragmenting through relocation of live objects in order to coalesce discontiguous free segments.
Stung by complaints from residents, the City Council called Monday for a study of costs related to garbage collection and promised to consult with neighborhood councils before it decides whether to impose a fee that would boost homeowners' trash bills by 233 percent.
The JamaicaVM supports INTEGRITY native threads and inter-process communication, and offers a runtime system for hard realtime applications through the use of the JamaicaVM's realtime garbage collection technology.
released a report in December suggesting that since suspending recycling, the Sanitation Department had reduced its garbage collection runs by less than 2 percent, the New York Times reports.
The burned-out household goods are part of the garbage collection that has piled up 10 meters high over a 5,000-square-meter land lot in the Ishihara district located adjacent to the garbage incinerator operated by Sakai Clean Center, a private garbage processing business.
One dumpster diver drove around affluent neighborhoods on garbage collection day.