views:

50

answers:

2

Hi,

I'm using C#.

Is it possible to check how much memory each variable in my code has been using during the runtime?

I can't get a clue as to which construct in my code has been using up memory which is ultimately leading my system to crash.

Thank You

A: 

Try to have a look at this article: http://www.codeproject.com/KB/dotnet/Memory_Leak_Detection.aspx

munissor
+2  A: 

There are several good memory profilers available such as ANTS Memory Profiler.

Alternatively you can use WinDbg + SOS. WinDbg is a free download from Microsoft and SOS is part of the .NET framework. Check Tess' blog for how to debug memory issues with WinDbg + SOS.

Brian Rasmussen