Finding MEMORY LEAKS in C# .NET Applications

Sdílet
Vložit
  • čas přidán 23. 06. 2024
  • 🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg
    🏃‍♂️ THIS is how you can FIND MEMORY LEAKS in C# .NET Applications!
    💻 Link to the Github repository! github.com/tutorialseu/csharp...
    We'll make sure to make a Developer out of you in no time!
    So, what is C#?
    C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in .NET. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers. This tour provides an overview of the major components of the language in C# 8 and earlier. If you want to explore the language through interactive examples, try the introduction to C# tutorials.
    To learn more, make sure to watch the video, and we promise you that you'll become a C# developer in no time! Have fun!
    #csharp #dotnet #coding #tutorial #learn #microsoft #net #memory #memoryleaks #leaks
    TAGS
    dotnet,csharp,dotnet core,windows service,.net core tutorial,.net core,.net,c#,Tutorials,Tutorial,Programming,Course,Learn,Step by step,guide,programmer,core,code,c sharp,sharp,net6,6.0,memory leak,memory,leak,detective,.net framework,debugging,windbg,.net memory profiler,memory leaks net,programming,visual studio,profiling,windows 10,programming for beginners,how memory leaks occur,coding,software engineering,how to debug,debug,breakpoints
    tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
    This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
    Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x
    Android: / @tutorialseuandroid
    C#: / @tutorialseuc
    Unity: / @tutorialseuunity
    Facebook: / tutorialseu-1093802040...
    LinkedIn: / tutorialseu
    Discord: / discord

Komentáře • 38

  • @tutorialsEUC
    @tutorialsEUC  Před rokem +1

    🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg

  • @gavinw77
    @gavinw77 Před 5 měsíci +6

    @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

  • @UnashamedlyHentai
    @UnashamedlyHentai Před rokem +7

    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.

    • @ridgero
      @ridgero Před 11 měsíci

      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.

  • @bogdan98ful
    @bogdan98ful Před 7 měsíci +5

    No memory leak, just increase of used memory due to the fact of using a static list.

  • @DelMadman
    @DelMadman Před 21 dnem

    very helpful, saved my day! thanks

  • @FranciscoAlvino
    @FranciscoAlvino Před rokem

    Wow!! Thanks for it 👏🏻👏🏻👏🏻

  • @user-kr9gc6ys2n
    @user-kr9gc6ys2n Před 8 měsíci

    It is really helpful guide:)
    Thanks for the help:)

  • @ishaarora3
    @ishaarora3 Před rokem +6

    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?

    • @shishlinsv
      @shishlinsv Před rokem

      Exactly because the list is static, and it can't be collected, I think. Anyway, it's just an example.

    • @bhanuprakashrao1460
      @bhanuprakashrao1460 Před 9 měsíci +5

      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.

  • @rodrigoramirez3870
    @rodrigoramirez3870 Před 9 měsíci

    Great video!

  • @SakthiVel-hq6zu
    @SakthiVel-hq6zu Před 7 měsíci +2

    gcroot -all [targetid] cmd is not working

  • @ncvjr
    @ncvjr Před 10 měsíci +3

    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.

  • @EdRawrDev5813
    @EdRawrDev5813 Před měsícem

    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?

  • @SDChillRide
    @SDChillRide Před rokem

    Why my program is not showing in the monitor list?

  • @user-yr9yn8yx2e
    @user-yr9yn8yx2e Před 4 měsíci

    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.

  • @alexnovikov4356
    @alexnovikov4356 Před 10 měsíci

    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.

  • @nursultanesirkegenov3289
    @nursultanesirkegenov3289 Před 5 měsíci

    Why just don't use Memory snapshot in VS and analyze by comparing two snapshots?

  • @user-rv9ug9ur1x
    @user-rv9ug9ur1x Před 2 měsíci

    my Debian can not find dotnet-counters after installing. I'm destroyed

  • @Cod3rMax
    @Cod3rMax Před rokem +2

    This topic i find it very complicated, couldn't understand it 😢

  • @SakthiVel-hq6zu
    @SakthiVel-hq6zu Před 7 měsíci

    gcroot -all cmd is not working

  • @hiryu70
    @hiryu70 Před rokem

    But if I have a leak only on production environment how can I get this dump and analyze it?

  • @baebcbcae
    @baebcbcae Před 7 měsíci +3

    cool, but unfortunately it is not memory leak

  • @DutchRider
    @DutchRider Před rokem +2

    Such a bad practise, you can do this all within visual studio itself, no need to install more tools..

    • @tutorialsEUC
      @tutorialsEUC  Před rokem +1

      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

    • @DutchRider
      @DutchRider Před rokem +1

      @@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 ;))

    • @tutorialsEUC
      @tutorialsEUC  Před rokem

      @@DutchRider Thanks for your honest opinion! 🙂

    • @dellosCao
      @dellosCao Před rokem

      still dont know how to done this in VS, Can you show me content

  • @emmacox9506
    @emmacox9506 Před rokem

    p͎r͎o͎m͎o͎s͎m͎ 😏