Q: How to profile VisualStudio's unittests

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Shrike
Posts: 3
Joined: Sat Nov 01, 2008 1:18 pm

Q: How to profile VisualStudio's unittests

Post by Shrike » Sat Nov 01, 2008 1:22 pm

Hello.

I need to profile unittests, while they are running under MSTest. The issue is tests are running in separate process VSTestHost.exe by VS itself. So all options of MemProfile (profile exe/asp.net/service) don't fit.

What are my options? Thanks.

Shrike
Posts: 3
Joined: Sat Nov 01, 2008 1:18 pm

Re: Q: How to profile VisualStudio's unittests

Post by Shrike » Sat Nov 01, 2008 1:43 pm

Shrike wrote:Hello.

I need to profile unittests, while they are running under MSTest. The issue is tests are running in separate process VSTestHost.exe by VS itself. So all options of MemProfile (profile exe/asp.net/service) don't fit.

What are my options? Thanks.
I'v found an option "Atach to process" and choose "VSTestHost" in list.
But then I got error that I don't have "Debugging Tools", but I do. I browse it to installation folder of 6.9.3.113 version of Debugging Tools for Windows - Native x64 (I have Windows Server 2003 x64 EE), but again got an error:
---------------------------
.NET Memory Profiler
---------------------------
The specified folder does not contain a valid installation of "Debugging Tools for Windows". Make sure that at least version 6.3.17 of the tools are installed in the folder and then try again.

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Mon Nov 03, 2008 7:24 pm

To profile unit tests using MSTest you should use the "Profile application" option and profile the MSTest executable. In order to prevent MSTest to spawn a separate test process (VSTestHost.exe) you need to supply the "/noisolation" argument. For more information about MSTest arguments, type "MSTest /help" in the command prompt.

When you attach to a process, the installed debugging tools must match the bitsize of the process. In order to attach to a 32-bit process, you need to install the 32-bit debugging tools, even if you're running on a 64-bit OS.

Since older versions of the profiler fails to locate the latest release of the debugging tools, it is also recommended that you use the latest version of .NET Memory Profiler (v3.1.319).
Best regards,

Andreas Suurkuusk
SciTech Software AB

Shrike
Posts: 3
Joined: Sat Nov 01, 2008 1:18 pm

Post by Shrike » Wed Nov 05, 2008 1:07 pm

Thanks a lot.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests