简体   繁体   中英

Memory profiling in Visual Studio 2013

I want to explore how memory is allocated in my application. I have C# console app and use Visual Studio 2013 Professional.

I go to Analyze -> Perfomance and Diagnostics and selected .NET memory allocation

在此输入图像描述

As a result I get the following summary:

在此输入图像描述

In the chart CPU usage(%) per time. But how can I see allocate memory per time and GC events? I can not find it here.

I've Read on msdn blog that this inspection tool is not oriented on Memory leak inspection, so there's not such features, that are planned for future versions. This is intended for large heap inspections.

http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio-2012.aspx

it was about 2012 but seems that thins are not still changed.

Adding to @L.Trabacchin's answer, you should take a look at dotMemory (formerly dotTrace Memory , see the bottom of that page) from JetBrains. There's a trial version, and from my personal experience I can't recommend it enough; it's an incredibly useful tool.

This blog post gives info on how to analyze memory leaks by analyzing dump files in VS 2013, but has a few requirements which are highlighted below. http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/20/using-visual-studio-2013-to-diagnose-net-memory-issues-in-production.aspx

To use the "Debug Managed Memory" feature discussed in this post:

  1. The option will only be available from the dump summary page in the Ultimate version of Visual Studio 2013 . If you are using Premium or Professional you will not see the option
  2. The process the dump file was collected against must have been running on .NET 4.5 or higher . If the dump was collected on 3.5 or previous the option will not appear, if it was collected on 4.0 it will fail to launch with an error message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM