Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to analyse program's memory usage in Visual Studio 2010?

Is there a way to check what memory has been allocated to in a program coded in VS 2010? I've been noticing that a recent program I've been making keeps using more and more memory over time without releasing any.

Also, are there any articles on code design that teaches you good memory management? I seem to be searching the wrong terms on google as I keep getting useless results.

like image 249
Ying Chan Avatar asked Nov 18 '10 09:11

Ying Chan


People also ask

How do I see RAM usage in Visual Studio?

To bring up the window again, click Debug > Windows > Show Diagnostic Tools. Choose Memory Usage with the Select Tools setting on the toolbar. Click Debug / Start Debugging (or Start on the toolbar, or F5). When the app finishes loading, the Summary view of the Diagnostics Tools appears.

How do I Analyse memory dump in Visual Studio?

Open the memory dump in Visual Studio by using the File > Open > File menu command and select your memory dump. Notice on the Memory Dump Summary page a new Action called Run Diagnostics Analysis.

How do I analyze memory usage in Windows?

Press Ctrl + Shift + Esc to launch Task Manager. Or, right-click the Taskbar and select Task Manager. Select the Performance tab and click Memory in the left panel. The Memory window lets you see your current RAM usage, check RAM speed, and view other memory hardware specifications.


1 Answers

There are commercial tools such as ANTS Memory Profiler or .NET Memory Profiler or dotTrace. Secondly, take a look at this MSDN article. Lastly, Maoni Stephens has many blog posts on garbage collection and memory management in .NET. They are all linked here.

like image 187
Daniel Rose Avatar answered Oct 12 '22 15:10

Daniel Rose