Pragmatic memory management
summary
Argues that most memory hacks cost far more than they save and gives concrete measurements: raw byte copy loops run about 32 bytes register efficient code versus about 16–32× slower for naive per‑byte loops, pushing optimized allocation into real wins of only about 10% throughput gain in a web request scenario. Shows GC behavior flips when buffers cross the 85 KB LOH threshold, Gen2 work jumps ~10×, minimum object overhead is 24 B minimum object size, and recommends profiling, simple pools, and adding RAM before complex rewrites.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 7:17Engineering memory approach
- 11:10Allocations optimization
- 21:28Performance testing
- 27:49Garbage collector myths
- 34:56Large objects and LOH
- 43:24When to help GC
- 51:35Memory vs optimization
- 57:21Q&A
related talks
01h 06m.NET Systems Programming Learned the Hard Way
48mManual Memory Management in .NET Framework
58mManual memory management in .NET Framework
59mHigh-performance code design patterns in C#
54mPragmatic Performance: When to care about perf, and what to do about it
43mPragmatic Performance: When to care about perf, and what to do about it.
01h 01mBoosting memory management in interoperability scenarios
57mMake your custom .NET GC — "whys" and "hows"
