..NET keeps track of your objects through a set of reference tables.
Every now and then (you have no control of when, though you can attempt to
force it using System.GC.Collect()) the garbage collector will go through
these tables and flag objects your program has no references to anymore.
It will then unravel these objects (which may have references of its own)
and release it from memory.
After that it will rearrange your objects to tidy up the use of memory
(allocating memory under .NET is actually faster than in native C).
However, since you have no control of when it runs, time and performance
critical applications may find that the garbage collector may run at a
time you really don't want it to. In that case, you can turn it off
alltogether and handle all memory by yourself.
Another limitation is using resources, like file handlers and database
connections, of which it isn't very good at cleaning up itself. So any
object that has a Close() method you should call Close() on when you are
finished using it.
PS! To release an object simply set the reference to null. The object
will float into the unknown, waiting to be eaten by the garbage collector.
--
Using M2, Opera's revolutionary e-mail client:
http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode and Nostalgia enabled