Skip to main content

Understanding Object Lifetime

  • Chapter
Pro C# 2010 and the .NET 4 Platform
  • 1034 Accesses

Abstract

At this point in the text, you have learned a great deal about how to build custom class types using C#. Now you will see how the CLR manages allocated class instances (aka, 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 to a region of memory termed the managed heap, where they will be automatically destroyed by the garbage collector “sometime in the future.”

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

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.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Andrew Troelsen

About this chapter

Cite this chapter

Troelsen, A. (2010). Understanding Object Lifetime. In: Pro C# 2010 and the .NET 4 Platform. Apress. https://doi.org/10.1007/978-1-4302-2550-8_8

Download citation

Publish with us

Policies and ethics