Garbage Collector

  • automatic memory management
  • allocates and releases memory
  • prevents memory leaks and accessing dead objects
  • provides memory safety
  • virtual memory space
  • defragments/compacts memory
  • heap have 3 generations
    • 0 – for new objects;
    • 1 – for objects that lives through GC from 0
    • 2 – for long living objects from 1 and 0
  • also Large Objects Heap (LOH) for big objects like arrays over 85,000 bytes

Further read:

https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals?source=recommendations

One Reply to “Garbage Collector”

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
17 + 14 =