Roadmap for garbage collection in the Microsoft .NET Framework (317866)



The information in this article applies to:

  • Microsoft .NET Framework
  • Microsoft Common Language Runtime (included with the .NET Framework) 1.0

This article was previously published under Q317866

SUMMARY

This article provides a roadmap to learn and master garbage collection in the Microsoft .NET Framework. To help you with learning a Microsoft product or technology, roadmap articles provide links to useful information, including online documentation, Microsoft Knowledge Base (KB) articles, and white papers.

This article contains the following sections:

Overview

Unlike COM, the common language runtime does not use reference counting to govern object lifetime. Instead, the garbage collector traces object references and identifies objects that can no longer be accessed by running code. This simplifies component programming a great deal, because you do not have to worry about circular references. If you use a group of objects in which the objects contain references to each other, but none of these objects are referenced directly or indirectly from stack or shared variables, garbage collection automatically reclaims the memory.

Therefore, garbage collection in .NET completely relieves the developer from the responsibility of tracking memory usage and determining when to release memory. However, it is important that you understand how garbage collection works. The following links provide overview information about garbage collection in Visual Studio .NET:

Reference counting, garbage collection, and object lifetime
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconReferenceCountingGarbageCollectionObjectLifetime.htm

Object lifetime: How objects are created and destroyed
http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconFinalizeDestructors.htm

Garbage collection: Automatic Memory Management in the Microsoft .NET Framework Part-1
http://msdn.microsoft.com/library/en-us/dnmag00/html/GCI.htm

Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework Part-2
http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/

back to the top

Architecture

The following links provide architectural information about the garbage collector in .NET: back to the top

Key concepts

The following links lead to documentation about key .NET garbage collection concepts: back to the top

How to articles

How To articles provide step-by-step instructions for performing specific tasks. Run the following Microsoft Knowledge Base query to return How To articles about Visual Studio .NET. After you have reached the query page, you can narrow your search by providing additional search criteria: back to the top

Troubleshooting

If you experience problems, you can visit Microsoft newsgroups, where you can share your experiences with your peers, or you can search the Microsoft Knowledge Base (KB) for KB articles about specific issues: back to the top

Modification Type:MajorLast Reviewed:10/6/2005
Keywords:kbGarbageCollect kbinfo KB317866 kbAudDeveloper