© Vaskaran Sarcar 2018
Vaskaran SarcarInteractive C#https://doi.org/10.1007/978-1-4842-3339-9_14

14. Memory Cleanup

Vaskaran Sarcar
(1)
560066 Bangalore, Karnataka, India
 
Teacher starts the discussion: Managing memory is an important concern for programmers. But .NET tried to make their lives easier by taking the responsibility of clearing those objects that have no use after a particular point. In programming, we call them dirty objects or unreferenced objects.
The garbage collector program runs in background as a low-priority thread and keeps track of dirty objects . .NET runtime on regular intervals can invoke this program to remove unreferenced or dirty objects from memory.
However, there is a catch. Some objects require special teardown codes ...

Get Interactive C#: Fundamentals, Core Concepts and Patterns 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.