Skip to main content

Understanding Object Lifetime

  • Chapter
Pro C# with .NET 3.0
  • 463 Accesses

Abstract

In the previous chapter, you learned a great deal about how to build custom class types using C#. Here, you will come to understand how the CLR is managing allocated objects via garbage collection. C# programmers never directly deallocate a managed object from memory (recall there is no “delete” keyword in the C# language). Rather, .NET objects are allocated onto a region of memory termed the managed heap, where they will be automatically destroyed by the garbage collector at “some time in the future.”

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Andrew Troelsen

About this chapter

Cite this chapter

(2007). Understanding Object Lifetime. In: Pro C# with .NET 3.0. Apress. https://doi.org/10.1007/978-1-4302-0201-1_5

Download citation

Publish with us

Policies and ethics