Encyclopedia > Reference counting

  Article Content

Reference counting

In computer science, a garbage collection technique where each memory cell contains a count of the number of other cells which point to it. If this count reaches zero the cell is freed and its pointers to other cells are followed to decrement their counts, and so on recursively.

This technique cannot cope with circular data structures. Cells in such structures refer (indirectly) to themselves and so will never have a zero reference count. This means they would never be reclaimed, even when there are no references from outside the structure.


This article (or an earlier version of it) contains material from FOLDOC, used with permission.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
North Lindenhurst, New York

... town the population is spread out with 25.6% under the age of 18, 7.5% from 18 to 24, 33.8% from 25 to 44, 21.3% from 45 to 64, and 11.8% who are 65 years of age or older. ...

 
 
 
This page was created in 31.3 ms