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

1.6k Views Asked by At

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#.

1

There are 1 best solutions below

0
On

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:

Other similar questions on StackOverflow: