Page 1 of 1

Profiling NUnit's child processes

Posted: Thu Nov 17, 2011 5:46 pm
by pdseale
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

Re: Profiling NUnit's child processes

Posted: Fri Nov 18, 2011 5:22 pm
by Andreas Suurkuusk
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.