O'Reilly logo

CLR via C#, 3rd Edition by Jeffrey Richter

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 21. Automatic Memory Management (Garbage Collection)

In this chapter:

Understanding the Basics of Working in a Garbage-Collected Platform 520

The Garbage Collection Algorithm 523

Garbage Collections and Debugging 527

Using Finalization to Release Native Resources 530

Using Finalization with Managed Resources 537

What Causes Finalize Methods to Be Called? 540

Finalization Internals 541

The Dispose Pattern: Forcing an Object to Clean Up 544

Using a Type That Implements the Dispose Pattern 548

C#'s using Statement 551

An Interesting Dependency Issue 554

Monitoring and Controlling the Lifetime of Objects Manually 555

Resurrection 566

Generations 568

Other Garbage Collection Features for Use with Native Resources 574

Predicting ...

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