GC in .net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the name of the Gc alogorithm used by .net?

What is the difference between Finalize() and Destructor()?
 
What is the name of the Gc alogorithm used by .net?

AFIK, the .NET GC is a generational garbage collector.
What is the difference between Finalize() and Destructor()?

Effectively nothing. In C#, all the ~YourClassName() does is override
finalize.
 
The *algorithm* it uses as to whether objects are alive or not is called Mark and Sweep. Yes it also performs generational compaction as well. And of course it doesn't always compact the heap either, it uses heuristics to assess the benefit of compacting compared with the overhead of all the memory copies.

http://msdn.microsoft.com/library/d...y/en-us/dndotnet/html/highperfmanagedapps.asp

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

No, it is not a simple Mark and Sweep gc (which usually don't move objects
in memory), it is a generational gc that works by copying live objects to
avoid memory fragmentation (with special handling for large objects).

You 'll get a good overview at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetGCbasics.asp
 
Back
Top