Live data from Hacker News

Preparing for the .NET 10 GC

maoni0.medium.com

11–20 of 64 posts

Re: Preparing for the .NET 10 GC

#11
post #10

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…

> 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.

Re: Preparing for the .NET 10 GC

#13
post #4
post #2

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...

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.)

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).

Re: Preparing for the .NET 10 GC

#14
post #5

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.)

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.

Re: Preparing for the .NET 10 GC

#15
post #9
post #5

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.)

I don't generally find them low quality, but I do wish people wouldn't use it since I don't subscribe to it.

Its the Pinterest of blogs, its really annoying.

Re: Preparing for the .NET 10 GC

#16
post #7
post #5

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.)

Or if the author used their real name.

Agree. It's not like a blogpost that is about grey hat subjects or something.

Re: Preparing for the .NET 10 GC

#17
post #5

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.)

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.

Maoni0 is the mastermind behind the .NET GC. They won't judge you, and if they do, that's their problem.

Re: Preparing for the .NET 10 GC

#18
post #7
post #5

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.)

Or if the author used their real name.

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.

Re: Preparing for the .NET 10 GC

#19
post #6
post #2

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...

> 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.

[dead]
Post reply on HN