Back In the print window choose "Save as PDF" as the destination
NOTE.CS

Garbage Collection in .NET

1 topic ยท 28 Nov 2026
1

Garbage Collection in .NET

C#

The GC frees heap objects that are no longer referenced. It is generational: Gen 0 (new, collected often), Gen 1, Gen 2 (long-lived). Large objects (> 85 KB) go to the Large Object Heap.

Unmanaged resources (files, sockets, DB connections) are not handled by the GC: implement IDisposable and use using.