.NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection
Architecture in one line
Source → Roslyn → assembly (IL + metadata + manifest) → host starts CLR → loader + type loader → JIT (tier 0 → tier 1 + PGO) → native code → GC manages heap.
Version map
Framework 1.0 (2002) → 2.0 generics → 3.5 LINQ → 4.0 TPL → 4.5 async → 4.8 last (4.8.1 ARM64). Core 1.0 (2016) → 2.1 LTS → 3.1 LTS. .NET 5 (2020) → 6 LTS → 7 → 8 LTS → 9 → 10 LTS (2025). Even = LTS 3 yrs, odd = STS 2 yrs.
GC essentials
Gen 0 → 1 → 2; LOH ≥ 85,000 bytes (not compacted); POH for pinned; Workstation vs Server (+ background, DATAS); roots = stacks, statics, handles; finalizers delay collection; never GC.Collect() in normal code.
Dispose rules
using/await using everything disposable · SafeHandle instead of finalizers · Dispose(bool) + GC.SuppressFinalize for the full pattern · dispose what you own only.
Diagnose
dotnet-counters (live) · dotnet-gcdump (heap) · dotnet-dump analyze (dumpheap -stat, gcroot) · dotnet-trace (CPU/events) · BenchmarkDotNet MemoryDiagnoser.