Pinned Tweet
A Thread - a guideline doc for memory performance analysis for #dotnet #dotnetcore
For the past few weekends I've been working on a (long) document that aims to help you with finding efficient approaches to mem perf problems.
github.com/Maoni0/mem-doc/bl…
hi folks! it’s been quite a while since I had time to write a blog post. with the upcoming .NET 10 release, I’m finally sharing more details on DATAS and tuning tips you might find useful. check it out here:
maoni0.medium.com/preparing-…
recently we worked with a team that specified only the provider name in dotnet-trace without keywords/level. dotnet-trace will include ALL keywords on VERBOSE level. this can easily degrade perf. DotNETRuntime provider will also induce GCs (due to the GCHeapCollect keyword).
I've requested the diagnostics folks to the change the default: github.com/dotnet/diagnostic…. note that this means no keywords enabled on informational level.
profiling tip - if you upgrade to a newer version of a product and observe perf regression, make sure to grab some perf traces before you revert (if you revert all usage and can't easily get traces later). without comparative traces the investigation will be much harder
if you use PerfView, have you noticed the GCTriggeredStacks cmd arg? to see callstacks for induced GCs, use this lightweight commandline -
PerfView /GCCollectOnly /GCTriggeredStacks /nogui collect
(this is less verbose than what mem-doc currently shows)
if I could only give one piece of advice to folks who need to do memory perf analysis, it would be to learn to use traces. tracing has existed for multiple decades and I still come across folks who need to do memory analysis and never use it. it really is a loss on productivity.
very cool visualization tool to show case GC activities -
In preparation for my talk at @update_conf, I've prepared a tool to visualize the activity of the GC. It was initially meant as a gimmick, but it turns out to be a good way to understand some GC mechanisms.
For instance, here you can see the effect of DOTNET_GCDynamicAdaptationMode=1 on the lower side, dynamically scaling up the number of heaps to absorb a spike of traffic, then scaling back down. The top application is running with default settings. Both are receiving the same traffic.
#dotnet #progc2
what's new in the .NET 8.0 GC? we focused on solving the Server GC problem where it keeps too much memory around. the new DATAS feature aims to keep the memory usage much more in line with what your app requires. maoni0.medium.com/dynamicall…
2nd edition of the Pro .NET Memory Management book is coming🙂
I am thrilled to announce that we've begun work on the Second Edition of Pro .NET Memory Management, with the awesome @chnasarre and @KooKiz as co-authors!
Let's upgrade those 1000+ pages about memory for .NET 7 and beyond, all under the watchful eye of reviewer @maoni0 👀
@benmwatson, one of the perf engineers on the Bing backend team, just published a blog post about the perf improvements they've observed as they upgraded to .net 6/7
devblogs.microsoft.com/dotne…
"in testing we saw about a 24% average improvement in the amount of time the process spends in GC (which isn’t much to start with). In production, it was even better, closer to 30%."
making .net better on AWS! great experience working with @socketnorm on this.
Here is my new blog post about some interesting details about the .NET Garbage Collector and AWS ECS and Lambda. If you are having any memory issues with .NET and these services definitely check it out.
Thanks to @maoni0 for collaborating on this post.
aws.amazon.com/blogs/develop…
I literally just wrote 3 emails to 3 different teams to ask them to capture a top level GC trace to understand their memory behavior in general. 99.9% of the time this is the BEST way to start a memory investigation. github.com/Maoni0/mem-doc/bl…
I don't know how gas leaf blowers are still a thing - they should be banned from everywhere. if you live in Kirkland, WA, would you consider signing this?
Ban Nasty Gas-Powered Leaf Blowers in Kirkland - Sign the Petition! chng.it/7MTMcwWr via @Change
a new API GC.GetTotalPauseDuration is available in .NET 7 learn.microsoft.com/en-us/do…. it gives you the total amount of time paused in GC since the beginning of the process. should be a good aid in your performance monitoring.
I added a FAQ section to mem-doc github.com/Maoni0/mem-doc/bl… that includes the following so far -
◼️I didn't change my code at all, why am I seeing a regression in memory when I upgrade my .NET version?
◼️Why isn't the GC collecting these objects? They should be collected!
A Thread - a guideline doc for memory performance analysis for #dotnet #dotnetcore
For the past few weekends I've been working on a (long) document that aims to help you with finding efficient approaches to mem perf problems.
github.com/Maoni0/mem-doc/bl…
over the holidays I read "Every Patient Tells a Story" by Lisa Sanders (technical advisor to the House show). it's about how doctors solve hard to diagnose medical problems. an interesting read,I also see a lot of similarities with how SW engineers do diag. a couple of examples -
it has been pointed out to me (a reason that I had not considered myself) another reason is because they "don't want to look stupid to their teammates" and that's more common with junior folks. you'd be doing yourself a disservice by doing that, especially if you are junior.





