C# › Memory & Garbage Collection
What is the difference between managed and unmanaged resources?
BeginnerAnswer
Managed resources are handled by the GC; unmanaged resources (file handles, sockets, native memory) are not and must be released via Dispose/finalizers.
using var file = File.OpenRead(path); // wraps an unmanaged handleReal-world example Wrapping a native handle in an IDisposable so it's freed deterministically.