What is garbage collection in .NET?

Automatic memory management by the CLR.

Process:

  • The garbage collector periodically scans the heap for objects that are no longer referenced.
  • It reclaims the memory occupied by those objects.

Benefits: Prevents memory leaks and simplifies memory management.

Leave a Reply

Your email address will not be published. Required fields are marked *