Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analyzing memory dump to find leak

We have a c# .NET application that has a memory leak in it. I used procdump to get a memory dump from a running instance of the application from a production machine. The production machine is running 32 bit Windows XP, and .NET 4.0.

The exe config is set to .net 4.0

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

When I pull the dump to my dev box, windows 8.1 64bit, and open it with VS 2013 the dump is initially opened fine. However, when I click the Debug Managed Memory action I get the following error message:

Memory analysis is not supported for the CLR version used in this process.

I'm new to troubleshooting memory leaks in Windows and managed memory environments, and know next to nothing about the tools involved. I did a google search for the error I get, and didn't find anything. Any help is appreciated. I apologize if I am missing something obvious - Junior Dev here :-)

like image 397
user2907728 Avatar asked Oct 21 '22 22:10

user2907728


1 Answers

I don't know if procdump can be used to find a memory leak in .NET. One effective way I tried is: using Windbg and SOS. There are two posts explains how to use Windbg+ SOS to track .NET memory leaks:

  1. Where's your leak at? [Using WinDbg, SOS, and GCRoot to diagnose a .NET memory leak]
  2. Debugging managed code memory leak with memory dump using windbg

If you don't like Windbg, the tool DebugDiag is also very effective tool in tracking down memory leaks.

like image 178
Matt Avatar answered Oct 24 '22 11:10

Matt