@tutorialsEUC Note that the 'gcroot' command that you use here will no longer work as of 2023. They have dropped the -all option, as the tool and system are apparently fast enough now to just do -all everytime. So the correct usage is > gcroot
Unless I'm misunderstanding here, this is more "where your memory is being used." I don't see anything that I would call a leak here. Everything is intentional by virtue of that fact that statically scoped items are always in scope.
Yes, it's a "forgotten memory", but In the end this will cause a System.outofMemoryException, because memory won't be released until you will correct the code.
Is it because the list is static and not collected by GC, there is having a memory leak? Could you please also explain why is there a memory leak here?
It's not a memory leak. It just unbounded memory increase. This tutorial helps in debugging such issues, which causes the memory of the application to increase over time. Its very hard to write code which leaks memory in languages like c#, since most of the code is managed. Only when you ( or the SDK you use) are not properly handling un-managed resources ( not disposing the IDisposible classes etc), do we get a memory leak and even then it is not a leak in managed code and so hard to debug using this method.
Ok. In the real world application we have many threads, Lists, Arrays and probably the performance issue is not obvious like all examples about .net profiling. I need to study much more about this topic.
Quick questions , what is the average GC heap size for a Mobile Xamarin or Maui app ? It could be any app but I'm asking about a mobile app environment?
Hi, Microsoft themself suggest to use this tool for first-level performance investigation: learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters I'd not say that this is a bad practicse but an introduction into the world of performance monitoring at all. Greets, Jannick
@@tutorialsEUC it's very bad though, and I fully don't understand why they are doing this, while in your diagnostics window you've everything you need :) nonetheless your video is still helpfull to search what you need cuz it's basically the same steps (just saves some typing and installing tools ;))
🚀C# Progress Academy - Become a senior C# developer: academy.tutorials.eu/p/csharp-progress-academy
@tutorialsEUC Note that the 'gcroot' command that you use here will no longer work as of 2023. They have dropped the -all option, as the tool and system are apparently fast enough now to just do -all everytime. So the correct usage is > gcroot
Your video help me to fix an issue on a Worker service I was working with, that was accumulating 25GB of RAM over few days. Thank you!
No memory leak, just increase of used memory due to the fact of using a static list.
Unless I'm misunderstanding here, this is more "where your memory is being used." I don't see anything that I would call a leak here. Everything is intentional by virtue of that fact that statically scoped items are always in scope.
Yes, it's a "forgotten memory", but In the end this will cause a System.outofMemoryException, because memory won't be released until you will correct the code.
Is it because the list is static and not collected by GC, there is having a memory leak? Could you please also explain why is there a memory leak here?
Exactly because the list is static, and it can't be collected, I think. Anyway, it's just an example.
It's not a memory leak. It just unbounded memory increase. This tutorial helps in debugging such issues, which causes the memory of the application to increase over time.
Its very hard to write code which leaks memory in languages like c#, since most of the code is managed. Only when you ( or the SDK you use) are not properly handling un-managed resources ( not disposing the IDisposible classes etc), do we get a memory leak and even then it is not a leak in managed code and so hard to debug using this method.
Ok. In the real world application we have many threads, Lists, Arrays and probably the performance issue is not obvious like all examples about .net profiling. I need to study much more about this topic.
very helpful, saved my day! thanks
I learn some new CMD, Thanks. Add the fix for such code to make it consume less memory, then compare the result, it will be more helpful.
It is really helpful guide:)
Thanks for the help:)
Quick questions , what is the average GC heap size for a Mobile Xamarin or Maui app ? It could be any app but I'm asking about a mobile app environment?
i know Microsoft recommends this, but all that is available in VS even in community edition. no need typing commands just using the profilers in VS.
gcroot -all [targetid] cmd is not working
use without -all
Wow!! Thanks for it 👏🏻👏🏻👏🏻
You're welcome 😊
Why just don't use Memory snapshot in VS and analyze by comparing two snapshots?
Great video!
This topic i find it very complicated, couldn't understand it 😢
hi, what exactly don't you understand? :)
cool, but unfortunately it is not memory leak
What do you mean?
Why my program is not showing in the monitor list?
But if I have a leak only on production environment how can I get this dump and analyze it?
gcroot -all cmd is not working
my Debian can not find dotnet-counters after installing. I'm destroyed
Such a bad practise, you can do this all within visual studio itself, no need to install more tools..
Hi, Microsoft themself suggest to use this tool for first-level performance investigation: learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters
I'd not say that this is a bad practicse but an introduction into the world of performance monitoring at all.
Greets,
Jannick
@@tutorialsEUC it's very bad though, and I fully don't understand why they are doing this, while in your diagnostics window you've everything you need :) nonetheless your video is still helpfull to search what you need cuz it's basically the same steps (just saves some typing and installing tools ;))
@@DutchRider Thanks for your honest opinion! 🙂
still dont know how to done this in VS, Can you show me content
p͎r͎o͎m͎o͎s͎m͎ 😏