Let’s refresh our memory! Memory management in .NET.
summary
Claim: gen2 collections sometimes pause apps for seconds to minutes; the large object heap is not compacted by default and can produce misleading OOMs. Demos show that calling Dispose prevents objects landing in the finalizer queue (saving an extra GC cycle), switching from full-string JSON loads to streaming plus reuse flattens memory, and using ClrMD invasive attach lets code enumerate heap objects, find retention paths, and count surprising string duplicates. Tools: IL, profilers, ArrayPool, CLRMD.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:08NET runtime
- 1:48Memory management and GC
- 2:46NET memory management 101
- 7:00The .NET garbage collector
- 10:47Helping the GC, avoid pauses
- 17:27When is memory allocated?
- 18:17Hidden allocations!
- 24:24Measure!
- 32:43Object pools / object re-use
- 33:36Garbage Collector summary
- 34:18How would you...
- 35:38Stuff on the Stack
- 35:56Stuff on the Managed Heap
- 36:24Theory is nice...
- 46:37Conclusion
related talks
48mManual Memory Management in .NET Framework
40mDeterministic Memory Management for Managed Runtimes
44mDebugging memory corruptions in C++
55mMemory Model: Get your shared data under control
56mKilling Uninitialized Memory: Protecting the OS Without Destroying Performance
01h 05mSelf-Aware Applications: Automatic Production Monitoring
01h 04mThe C++ Memory Model
01h 10mJava Memory Model (JMM) for Beginners and Advanced Users
