© Ali Asad and Hamza Ali 2017

Ali Asad and Hamza Ali, The C# Programmer’s Study Guide (MCSD), 10.1007/978-1-4842-2860-9_7

7. Manage Object Life Cycle

Ali Asad and Hamza Ali1

(1)Sialkot, Pakistan

In .NET, the “life cycle” of an object is the length of time between its creation and its destruction. In this chapter, we'll learn:

  1. Fundamentals of Object Life Cycle

  2. Fundamentals of .NET Garbage Collection

  3. Management of Unmanaged Resources

  4. Management of Memory Leaks

Fundamentals of Object Life Cycle

The life cycle of an object is simply the time between when an object is created in memory and when it is destroyed from it. Fundamentally, the life cycle of an object involves the following two steps:

  1. Creation of an Object

  2. Deletion of an Object

Creation of an ...

Get The C# Programmer’s Study Guide (MCSD): Exam: 70-483 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.