How the .NET Garbage Collector Works
Talk it through out loud with your AI coach.
The problem
- hard
- Pro
A .NET service running in a container slowly grows its memory until the container is killed. Explain how the .NET garbage collector works, how a garbage-collected app can still leak memory, and how you'd investigate this one.
What a strong answer covers
- How the collector organises objects by age and why.
- The special treatment of large allocations.
- What a leak means when memory is managed for you.
- A practical way to find what's holding on to memory.
Common mistake: Calling GC dot Collect or adding Dispose everywhere, when the real problem is something still holding references.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud