problem using API

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
jensod
Posts: 5
Joined: Fri Jun 14, 2013 3:08 pm

problem using API

Post by jensod » Fri Jun 14, 2013 3:26 pm

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

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

Re: problem using API

Post by Andreas Suurkuusk » Sat Jun 15, 2013 7:49 am

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 http://cdn.memprofiler.com/download/Mem ... 4_6_40.exe.
Best regards,

Andreas Suurkuusk
SciTech Software AB

jensod
Posts: 5
Joined: Fri Jun 14, 2013 3:08 pm

Re: problem using API

Post by jensod » Wed Jun 19, 2013 2:12 pm

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

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

Re: problem using API

Post by Andreas Suurkuusk » Thu Jun 20, 2013 7:41 am

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 support@scitech.se so that we can investigate this further?
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests