Hello, I’m a university student taking a subject on Garbage Collectors. And when we talked about the GC in .NET platform, he said there is not much published yet about the .NET compiler, but if I’m not wrong, the .NET platform is Open Source, and also the Roslyn Compiler, so, I was wondering where could I find papers or specific information on the GC of .NET. Thank you in advance.
There’s some official documentation on the GC on docs.microsoft.com, there’s the dotnet GitHub where you can indeed inspect the source code, and I’d recommend searching some of Maoni Stephens’ blog posts about the subject, since she seems to be the primary expert on it.
Roslyn btw is not relevant. It compiles C# code to IL, but garbage collection does not come into play there. The GC is a feature of the CLR.
Roslyn is getting more and more obsolete as native compilation/aot compilation becomes more and more of a reality in C#.
The GC is open source and somewhere I read that the number of scientific papers using .NET as a basis is increasing.
This performance article includes an overview of the .NET GC: https://github.com/Maoni0/mem-doc/blob/master/doc/.NETMemoryPerformanceAnalysis.md
The Book of the Runtime (BOTR) has a chapter on GC.
lecturers xD
It’s definitely open-source and available on GitHub in the various repos. That doesn’t mean it’s completely documented, but I find in general the people who are interested in deep internals of the GC don’t understand why the source code isn’t documentation enough. Sigh.
Pro .NET Memory Management is the only book I know that’s attempted to take on the task of documenting it all. It’s a tiny bit out of date, but is modern enough to discuss the .NET Core GC’s differences. It’s a THICK book, 600+ pages, but part of its main goal is explaining enough of the architecture that you can source-dive to figure out what’s changed since it was published.
One frustrating thing in programming is the darker the corner, the less likely people have explained it in a way that helps newcomers understand. The GC is definitely a dark corner of .NET: most people can spend an entire career with only a superficial understanding of how it works. That means there isn’t a lot of money or glory in explaining it, which is usually what motivates people to spend a year+ explaining it.
C# devs
null reference exceptions