← Explore learning paths

For .NET developers

Mastering Memory Management and Garbage Collection in .NET

Connect .NET garbage collection, allocation, ownership, and pooling to practical memory and performance decisions.

26 lessons ready to readFree to readLearn at your own pace
Read the first lesson → My progress in this path →
01 / READ

Start with a lesson that meets you where you are.

02 / PRACTICE

Try questions to check what you understand.

03 / RETURN

Sign in to keep your practice progress together.

Your learning path

26 of 78 topics have lessons available today. Choose any available lesson.

  1. 01

    Memory Fundamentals

    Read the lesson, then try the practice.

  2. 02

    Stack Allocation

    Read the lesson, then try the practice.

  3. 03

    Stackalloc and Span<T>

    Read the lesson, then try the practice.

  4. 04

    Heap Allocation

    Read the lesson, then try the practice.

  5. 05

    Object header and layout

    Read the lesson, then try the practice.

  6. 06

    Value vs Reference Types

    Read the lesson, then try the practice.

  7. 07

    Boxing and unboxing

    Read the lesson, then try the practice.

  8. 08

    Garbage Collection Fundamentals

    Read the lesson, then try the practice.

  9. 09

    Generational Model

    Read the lesson, then try the practice.

  10. 10

    GC Roots and Tracing

    Read the lesson, then try the practice.

  11. 11

    Collection Triggers

    Read the lesson, then try the practice.

  12. 12

    GC Modes and Adaptive Behavior

    Read the lesson, then try the practice.

  13. 13

    Workstation vs Server GC

    Read the lesson, then try the practice.

  14. 14

    Background and Concurrent GC

    Read the lesson, then try the practice.

  15. 15

    DATAS

    Read the lesson, then try the practice.

  16. 16

    Retention Bugs in Managed Code

    Read the lesson, then try the practice.

  17. 17

    Diagnostic Techniques

    Read the lesson, then try the practice.

  18. 18

    Modern Allocation Primitives

    Read the lesson, then try the practice.

  19. 19

    Span<T> and ReadOnlySpan<T>

    Read the lesson, then try the practice.

  20. 20

    Memory<T> and ReadOnlyMemory<T>

    Read the lesson, then try the practice.

  21. 21

    Safe vs Unsafe Patterns

    Read the lesson, then try the practice.

  22. 22

    Span escape analysis

    Read the lesson, then try the practice.

  23. 23

    Buffer Ownership and Pooling

    Read the lesson, then try the practice.

  24. 24

    ArrayPool<T>

    Read the lesson, then try the practice.

  25. 25

    IBufferWriter<T> and Writers

    Read the lesson, then try the practice.

  26. 26

    ReadOnlySequence<T>

    Read the lesson, then try the practice.

Topics without lessons yet

These are part of the outline. Lessons are not available for them yet.

  • Stack frame lifecycle
  • Stack limitations
  • Small Object Heap (SOH)
  • Large Object Heap (LOH)
  • Struct semantics
  • Reference type overhead
  • Gen0 ephemeral collection
  • Promotion mechanics
  • Gen2 and full collections
  • Root types
  • Mark and sweep
  • Finalization pipeline
  • Allocation threshold
  • Induced collections
  • Memory pressure signals
  • Workstation GC
  • Server GC
  • Choosing the right mode
  • Background GC mechanics
  • Foreground vs background pauses
  • Non-concurrent workstation fallback
  • Allocation rate feedback
  • Latency vs throughput decisions
  • What DATAS doesn't change
  • Event Handler Leaks
  • Strong references via delegates
  • Unsubscribe patterns
  • Static event anti-pattern
  • Cache and Collection Leaks
  • Unbounded static caches
  • Dictionary key retention
  • TimerQueue and callback leaks
  • Memory snapshots and diffs
  • Shortest root path analysis
  • GC event traces
  • ref struct constraints
  • Slicing without allocation
  • stackalloc integration
  • Async method compatibility
  • MemoryManager<T> backing
  • Field storage and lifetime
  • Use-after-free prevention
  • Unsafe buffer access
  • Rent and return discipline
  • Shared vs custom pools
  • Array size bucketing
  • IBufferWriter<T> contract
  • ArrayBufferWriter<T>
  • Custom writer implementations
  • Segment-based enumeration
  • SequenceReader<T>
  • Position and slicing