Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to know how many objects of a type are loaded in Visual Studio 2013

I would like to know if while debugging, is possible to know how many objects of a type are loaded using a Visual Studio 2013. I am currently developing in C#.

like image 452
Alexx Avatar asked Dec 14 '13 13:12

Alexx


1 Answers

It depends on the edition of Visual Studio you're using whether there's native support for this with a nice GUI. The .NET Memory Allocation Profiler can help you view the number of objects in memory, it ships with Visual Studio Premium and Ultimate. You can also use a more hard-core technique using Sons-of-Strike, which can give you very detailed information, should you know what to look for. SoS works with any version of Visual Studio and even with the basic WinDbg debugger. Here's an additional tutorial from the Microsoft P&P group on the subject. To get SoS you need to download and install the Windows Debugging Tools whcih you can find here.

There are a number of 3rd party profilers as well, like:

  • Red-Gate Ants Memory profiler
  • JetBrains dotTrace
  • Intel VTune
  • SciTech .NET Memory Profiler

Other similar questions on StackOverflow:

  • What Are Some Good .NET Profilers?
  • .NET Memory Profiling Tools
like image 179
jessehouwing Avatar answered Sep 20 '22 17:09

jessehouwing