Diagnosing memory leaks in .NET apps

Sdílet
Vložit
  • čas přidán 19. 06. 2024
  • In this episode, Software Engineer, Mike Rousos, joins Rich to show can we can use tools like dotnet-dump and Visual Studio to diagnose memory leaks in our .NET applications, even if they're running on a different OS.
    [00:55] - What are memory leaks?
    [04:45] - Inspecting memory leaks cross platform
    [18:30] - Using dotnet-dump
    [21:35] - Inspecting dumps in Visual Studio
    [27:03] - Inspecting dumps with dotnet-dump
    🙋‍♀️🙋‍♂️ Get your questions answered on the Microsoft Q&A for .NET: aka.ms/dotnet-qa
    🏫 Learn C#, F#, and .NET with free self-guided learning from Microsoft Learn: aka.ms/learndotnet
  • Věda a technologie

Komentáře • 22

  • @niezebenmansour3736
    @niezebenmansour3736 Před 4 měsíci +1

    Very helpful ! very happy to see diagnosing memory leaks subject in action into the .NET community

  • @AKW91
    @AKW91 Před měsícem +1

    The most common managed code memory leaks I had the pleasure to locate were almost always objects which had a method registered to a static event. For some reason a lot of developer think, that these are weakly referenced. By now I know what to search for, but since these are also often some kind of lambda expression, their origin is often very difficult to locate.

  • @tokenoftime8599
    @tokenoftime8599 Před rokem +3

    Excellent video! Very informative and well presented. We need more showcases of this type of tool.

  • @expertreviews1112
    @expertreviews1112 Před rokem +2

    This was such an incredibly informative video.. thanks a LOT

  • @rohit16db
    @rohit16db Před 2 lety +5

    Very good explanation, thank you so much for this. One question, you talked about gcroot command in video position 32.31 but i can't see that commend, can you explain what command you typed to get the location in actual source code?

  • @elghali6687
    @elghali6687 Před rokem

    Very helpful thank you

  • @lukejkw
    @lukejkw Před rokem +4

    I've never heard 2 guys so open about when they take a dump

  • @judew-devmon
    @judew-devmon Před rokem

    Very good. Thanks

  • @mnbvcggg
    @mnbvcggg Před rokem

    Great video. How can we get a creation stack trace. Which method created the instance. Thanks!

  • @GuilhermeCardoso-td8qu
    @GuilhermeCardoso-td8qu Před 9 měsíci +1

    By any chance you got an update about the OutOfMemoryException not tearing down process?

  • @emanuelporemba1640
    @emanuelporemba1640 Před 2 lety +3

    Is the GC aware of constructions like object A is holding a ref to object B and B is holding a reference to A, but no one else references A or B. Would it collect those objects at some point or not?

    • @taishi-sama-tfc
      @taishi-sama-tfc Před rokem +3

      Yes, it's one of the tasks of GC to clean up cyclic references. In .NET this done by creating a graph that contains all the objects that are reachable from the roots(static fields, local variables on a thread's stack, CPU registers, GC handles and etc.) and releasing all memory allocated for objects, unreachable from the application's roots.

  • @CrivatFlorin
    @CrivatFlorin Před rokem

    I have VS 2022 Community and I cannot find Actions > Debug managed memory after I open the dump file. Is it available for my version of VS?

  • @eclipsetutorialvideo
    @eclipsetutorialvideo Před rokem +2

    Useless if you don't use the enterprise VS :( we don't have debug managed memory option when we open the dump file

    • @NiklasLord
      @NiklasLord Před rokem +3

      I noticed that too. You can use dotnet-gcdump instead and open that in VS. Should be the same commands etc just add the gc part.

  • @prasannachoudhari8552
    @prasannachoudhari8552 Před 2 lety +2

    I could help but laugh at 16:31
    😂 r/nocontext

  • @user-lt9oy6td9u
    @user-lt9oy6td9u Před rokem +1

    its cool that it works on windows but on my macos i have wierd behavior..
    so running clrstack gives something like failed to find runtime module (libcoreclr.dylib). thats on .net 6.0 app build with rider using the arm sdk