Page 1 of 1

problem using API

Posted: Fri Jun 14, 2013 3:26 pm
by jensod
I am trying to use the SciTech.NetMemProfiler.MemProfiler.IsProfiling to detect if profiler is attached but it always return false.

For some reaon my application crash if started from the .NET Memory Profiler, so I attach using API after it has launched
I have no problem collecting snapshot using GUI

I am using 4.6 trial version on a x64 machine c:\Program Files\SciTech\NetMemProfiler4\Redist\MemProfiler2.dll (from v4.6)
I used this code successfully on 4.0 (payed version) on a x86 machine c:\Program Files\SciTech\NetMemProfiler4\Redist\MemProfiler2.dll (from v4.0)

The application under test was and still is x86

Re: problem using API

Posted: Sat Jun 15, 2013 7:49 am
by Andreas Suurkuusk
When you attach the profiler to a process, the information the profiler can retrieve from the process is limited and therefore the API cannot be used. That's why the MemProfiler.IsProfiling property returns false.

To use the API you need to start the process from the profiler. Starting using the profiler should definitely not crash your program and this is something we want to solve as soon as possible. First of all, can you download and test with the latest internal release of .NET Memory Profiler? You can download it from ... 4_6_40.exe.

Re: problem using API

Posted: Wed Jun 19, 2013 2:12 pm
by jensod
I have update to 4_6_40
And my application can now be started from the profiler

I can collect my initial snapshot OK
but when I try to collect a new snapshot after testcases has been executed
I often get a window with the following text:
.NET Memory Profiler
The operation failed with the following error:
Profiling stopped unexpectedly when collecting snapshot.

Re: problem using API

Posted: Thu Jun 20, 2013 7:41 am
by Andreas Suurkuusk
To get more information about your error, it would be good if you could provide us with logs from the profiler.

You can create log-files by using the command line below. This will create a set of log-files in the c:\MemProfilerLogs directory.

"C:\Program Files\SciTech\NetMemProfiler4\NetMemProfiler.exe" /log:c:\MemProfilerLogs

Can you send the log-files to so that we can investigate this further?