Preparing for the .NET 10 GC
27 comments
·September 24, 2025gwbas1c
pjmlp
The author is one of the main GC architects on .NET, so we in the known are aware of who she is.
Here is an interview with her,
https://www.youtube.com/watch?v=ujkSnko0JNQ
Having said this, I agree with you, the Aspire/MAUI architects do the same, I really don't get why we have to search for this kind of blog posts on other platforms instead of DevBlogs.
deburo
They should probably cross-post in both.
nu11ptr
I don't generally find them low quality, but I do wish people wouldn't use it since I don't subscribe to it.
giancarlostoro
Its the Pinterest of blogs, its really annoying.
justin66
Or if the author used their real name.
artimaeis
For what it's worth, Maoni is the author's real name. Maoni0 is what they go by everywhere. You can find interviews and plenty of their other content if you search around a bit.
justin66
Using a handle instead of their full name on an article is a choice. The first impression is not “knowledgeable employee making post about company’s product.”
Posting from a Microsoft blog would to some extent fix this, to the OP’s point.
(I know - who cares. But first impressions are what they are)
giancarlostoro
Agree. It's not like a blogpost that is about grey hat subjects or something.
giancarlostoro
Moreso if the authors profile picture wasn't what looks like a memecat. I can't exactly share this around without feeling like they'll judge it based on that alone.
pestkranker
Maoni0 is the mastermind behind the .NET GC. They won't judge you, and if they do, that's their problem.
orphea
For those who like me was left wondering what DATAS is, here is the link:
https://learn.microsoft.com/en-us/dotnet/standard/garbage-co...
bob1029
> Maximum throughput (measured in RPS) shows a 2-3% reduction, but with a working set improvement of over 80%.
I have a hard time finding this approach compelling. The amount of additional GC required in their example seems extreme to me.
neonsunset
[dead]
gwbas1c
Yeah, I kept scrolling to the top to see if I overlooked something.
Then I realized, "oh, it's hosted on Medium." (I generally find Medium posts to be very low quality.) In this case, the author implies that they are on the .Net team, so I'm continuing to read.
(At least I hope the author actually is on the .Net team and isn't blowing hot air, because it's a Medium post and not something from an official MS blog.)
olidb
Maoni Stephens is indeed on the .net team and is, as far as I know, the lead architect of the .net garbabe collector for many years: https://github.com/Maoni0 https://devblogs.microsoft.com/dotnet/author/maoni/
Therefore she's probably the person with the most knowledge about the .net GC but maybe not the best writer (I haven't read the article yet).
bilekas
It's incredibly frustrating the author doesn't actually say "Garbage Collector (GC)" I'm aware but something niggling in the back of my head had me second guessing.
nu11ptr
Even worse: they don't explain what the DATAS acronym means. Seems like the author makes too many assumptions about the knowledge base of their reader IMO.
jcmontx
But don't you take a hit in performance by running the GC more often?
stonemetal12
Maybe, maybe not. If GC is a O(n^2) then running it twice at n=5 is a much shorter run time than once at n=10.
NetMageSCW
Not necessarily if you have more (so smaller) heaps so each GC takes less time.
gwbas1c
One anecdote from working with .Net for over 20 years: I've had a few situations where someone (who isn't a programmer and/or doesn't work with .Net) insists that the application has a memory leak.
First, I explain that garbage collected applications don't release memory immediately. Then I get sucked into a wild goose chase looking for a memory leak that doesn't exist. Finally, I point out that the behavior they see is normal, usually to some grumbling.
From what I can tell, DATAS basically makes a .Net application have a normal memory footprint. Otherwise, .Net is quite a pig when it comes to memory. https://github.com/GWBasic/soft_matrix, implemented in Rust, generally has very low memory consumption. An earlier version that I wrote in C# would consume gigabytes of memory (and often run out of memory when run on Mono with the Bohem garbage collector.)
---
> If startup perf is critical, DATAS is not for you
This is one of my big frustrations with .net, (although I tend to look at how dependency injection is implemented as a bigger culprit.)
It does make me wonder: How practical is it to just use traditional reference counting and then periodically do a mark-and-sweep? I know it's a very different approach than .net was designed for. (Because they deliberately decided that dereferencing an object should have no computational cost.) It's more of a rhetorical question.
nu11ptr
> It does make me wonder: How practical is it to just use traditional reference counting and then periodically do a mark-and-sweep? I know it's a very different approach than .net was designed for. (Because they deliberately decided that dereferencing an object should have no computational cost.) It's more of a rhetorical question.
This is what CPython does. The trade off is solidly worse allocator performance, however. You also have the reference counting overhead, which is not trivial unless it is deferred.
There is always a connection between the allocator and collector. If you use a compacting collector (which I assumed .NET does), you get bump pointer allocation, which is very fast. However, if you use a non-compacting collector (mark-and-sweep is non-compacting), you would then fallback to a normal free list allocator (aka as "malloc") which has solidly higher overhead. You can see the impact of this (and reference counting) in any benchmark that builds a tree (and therefore is highly contended on allocation). This is also why languages that use free list allocation often have some sort of "arena" library, so they can have high speed bump pointer allocation in hot spots (and then free all that memory at once later on).
BTW, reference counting, malloc/free performance also impact Rust, but given Rust's heavy reliance on the stack it often doesn't impact performance much (aka just doing less allocations). For allocation heavy code, many of us use MiMalloc one of the better malloc/free implementations.
whaleofatw2022
Dotnet does both mark and sweep as well as compaction, depends on what type of GC happens.
gwbas1c
So basically you're trading lowering RAM consumption for higher CPU consumption?
FWIW: When I look at Azure costs, RAM tends to cost more than CPU. So the tradeoffs of using a "slower" memory manager might be justified.
nu11ptr
It depends on workload. It is difficult to quantify the trade offs without knowing that.
The problem is in languages like C#/Java almost everything is an allocation, so I don't really think reference counting would work well there. I suspect this is the reason PyPy doesn't use reference counting, it is a big slowdown for CPython. Reference counting really only works well in languages with low allocations. Go mostly gets away with a non-compacting mark-sweep collector because it has low level control that allows many things to sit on the stack (like Rust/C/C++, etc.).
neonsunset
[dead]
This post would carry a lot more authority if it was on an official MS or .net blog; instead of Medium. (I typically associate Medium with low-quality blog entries and don't read them.)