O'Reilly logo

Introducing Visual C# 2010 by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Garbage Collection

One of the most useful features of C# (and .NET more generally) is automatic memory management. When you create a new object, the memory required to store it is allocated automatically. You don't need to do anything specific when you have finished working with the object. The .NET runtime takes care of releasing the memory that the object was using for you.

The part of the .NET runtime that handles releasing memory is called the garbage collector (GC), and it generally works without you being aware that it is there and without you having to intervene in its operation. There are times, however, when an understanding of garbage collection can be useful, and there are some explicit steps you can take to help the garbage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required