This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: .NET Garbage Collection
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
From everything I've read about .NET's garbage collector, it seems that uses generational mark and sweep. It does a mark and sweep of the generation 1 space whenever it starts to get full and moves any survivors into generation 2 which is again garbage collected by mark and sweep. (and so on).
I find this very surprising and very worrying. Mark and sweep algorithms have to traverse all of the objects (garbage or not). Scavenging garbage collectors don't have to look at the garbage - they only take care of active objects. I would imagine (although I have no measurements to confirm this) that systems that allocate and free objects quickly (which happens a lot if you have auto-boxing) would be much better off with a scavenger. I wonder how long it will take Microsoft to implement one.