The basic principle of automatic memory management is simple: determine what data objects in a program cannot possibly be needed; throw them away.
It comes in several forms. Two common types are [Mark sweep GC]? and [Copying GC]?. Somewhat orthogonal to these two paradigms are heuristic?s such as [Generational GC]? and [Incremental GC]?.
[Reference Counting]? is commonly referred to as garbage collection, but this usage is technically inaccurate. Garbage collection is reserved for algorithms and systems that determine the liveness of data based on reachability. Reference counting has serious problems anyway, such as a general inability to deal with circular references and a high overhead in both space and time.
Several good sources of more detailed GC information are http://www.memorymanagement.org/ [memorymanagement.org] and http://www.cs.utexas.edu/users/oops/papers.html [publications by the OOPS]] group at the University of Texas