O'Reilly logo

Microsoft® Visual C#® 2005 Step by Step by John Sharp

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 13. Using Garbage Collection and Resource Management

After completing this chapter, you will be able to:

  • Manage system resources by using garbage collection.

  • Write code that runs when an object is finalized by using a destructor.

  • Release a resource at a known point in time in an exception-safe manner by writing a try/finally statement.

  • Release a resource at a known point in time in an exception-safe manner by writing a using statement.

You have seen in earlier chapters how to create variables and objects, and hopefully understand how memory is allocated when variables and objects are created (in case you cannot remember, value types are created on the stack, and reference types are given memory from the heap). Computers do not have infinite ...

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