Profiling NUnit's child processes

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
pdseale
Posts: 1
Joined: Thu Nov 17, 2011 5:42 pm

Profiling NUnit's child processes

Post by pdseale » Thu Nov 17, 2011 5:46 pm

Hello.

I'm trying to use SciTech to profile our NUnit test suite. Unfortunately the NUnit test runner now runs tests in a separate "nunit-agent.exe" process which I think SciTech is unable to detect. SciTech is trying to profile "nunit.exe" or "nunit-console.exe" and doesn't track the goings ons of "nunit-agent.exe".

Has anyone gotten SciTech to work with the NUnit GUI or NUnit console app? Either is fine, I just want to find our memory leak.

I've searched the forums and I don't see any recent (more recent than 2006) attempts to do so.

I've posted this on stackoverflow as well, if you want some karma over there: http://stackoverflow.com/questions/8069654/

Thanks, Peter

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

Re: Profiling NUnit's child processes

Post by Andreas Suurkuusk » Fri Nov 18, 2011 5:22 pm

NUnit will launch NUnit-agent if the platform or framework version do not match the NUnit executable. Since .NET Memory Profiler will connect to the first .NET process that is started, this will cause the unused NUnit executable to be profiled instead of NUnit-agent. To avoid this you will have to make sure that the correct platform and runtime version is used by NUnit. So to profile a 32-bit process on a 64-bit system, you need to start the "x-86" NUnit runner (e.g. NUnit-console-x86.exe). To profile a .NET 4.0 process, you need to add the <supportedRuntime> element to the ".exe.config" file. E.g.

<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0.30319" />
</startup>
</configuration>


I understand that this is not optimal. We will add better support for speciyfing the actual process to profile in a future version of the profiler.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests