Can I run a .NET garbage collection from WinDbg?

后端 未结 4 2109
北海茫月
北海茫月 2021-01-04 01:40

I\'m looking into why a managed process is using a lot of memory. Is there a way to run GC.Collect(3) from WinDbg, so that I can focus on the actual memory allo

4条回答
  •  长发绾君心
    2021-01-04 02:36

    I don't think there is any way to run a .NET garbage collection from WinDbg, but I also don't think it is necessary.

    See Rico Mariani's Performance Tidbits - Tracking down managed memory leaks (how to find a GC leak) for information about finding out what kind of stuff is on your heap.

    Additional possibly useful links:

    • When to call GC.Collect()
    • Scott Dorman - .NET Memory Management – Resources

提交回复
热议问题