All demos

How the garbage collector (GC) works in .NET

An interactive managed-heap model: generations 0/1/2, allocation budgets, Mark → Sweep → Compact phases, survivor promotion, and the large object heap (LOH).

Current phase Idle

Ready for the next action

Objects allocated 0
Gen 0 collections 0
Gen 1 collections 0
Gen 2 collections 0
Memory freed 0 KB
Objects promoted 0

Managed heap

reachable object garbage (unreachable) free space

Gen 0nursery — all new objects start here

0 / 256 KB

Gen 1survived one collection

0 / 320 KB

Gen 2long-lived objects (caches, static data)

0 / 512 KB

LOHobjects ≥ 85,000 bytes; collected only with Gen 2

0 / 640 KB