1. Computing & Technology

Discuss in my forum

Definition of Garbage Collection

By , About.com Guide

Definition: Garbage Collection is a process that many Operating Systems and some applications, especially services perform.

The purpose of Garbage Collection is to recover or reorganise system resources such as available blocks of RAM to prevent failure due to resource starvation.

Many applications allocate blocks of RAM for storing variables. When the blocks of RAM are no longer required they are returned to the application. The addresses of the blocks are usually stored on a free list and when the apllication later requests more RAM, it checks the free list first.

The effect of this over a period of time is to split RAM into smaller and smaller blocks. Eventually an application will request a block that is too big and fail. Garbage Collection merges all the free blocks into one large block.

In older languages like C++ programmers had to write their own Garbage Collection routines but newer languages like C# provide this.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Examples:
Defragging your hard disk is a type of Garbage Collection

©2012 About.com. All rights reserved.

A part of The New York Times Company.