0

I want to know core concept of Garbage Collector , Generally people learnt a lot stuff from internet but i am not satisfied how actually Garbage Collector work internally.

can anyone describe it. through memory terms? like how processor allocate Separate Memory to Garbage Collector and after than what is the life cycle of Garbage Collector?

BenMorel
  • 34,448
  • 50
  • 182
  • 322

1 Answers1

2

Garbage collector in .NET runs in a seperate thread. This thread will be running always at the back end. The garbage collector thread is given the lowest priority by default because running a seperate thread always means extra overhead. When system finds there is no space in the managed heap (managed heap is a bunch of memory allocated for the program at run time), then garbage collector thread will be given REALTIME priority and collect all the unwanted objects.

This link might be a good read: http://www.codeproject.com/Articles/5362/Garbage-Collection-in-NET-A-deeper-look-for-the-be

jester
  • 3,491
  • 19
  • 30