Show Failed Memory Assertions greyed out

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
theney
Posts: 4
Joined: Tue Feb 03, 2009 12:05 am

Show Failed Memory Assertions greyed out

Post by theney » Tue Feb 03, 2009 12:12 am

I have added code into the application I am profiling with comments. I start with

MemProfiler.AddRealTimeComment("Loading File");
MemSnapShot mSnapShot = new MemSnapShot();
mSnapShot = MemProfiler.FastSnapShot();

~ operation ~

and complete with

MemProfiler.AddRealTimeComment("Loading Complete, assert ...");
using (MemAssertion.BeginAssertions())
{
MemAssertion.NoNewInstances(mSnapShot);
}
MemProfiler.AddRealTimeComment("Assert Complete");

By viewing the realtime graph, I see that the comment Loading Complete ... is executed and the application does not continue, but I can not view the assertion dialog. I also added an if ... and it indicated that the assertion is true. I am running starting a windows service, not attaching.

What am I doing wrong?

Thanks

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

Post by Andreas Suurkuusk » Tue Feb 03, 2009 8:00 am

If the assertion returns true, it indicates that the assertion succeeded, i.e. there are no new instances. In this case, no assertion dialog will show up and the "Memory leak" button will not be available.

Do you expect your "~operation~" to create any new live instances? What do you mean that the application does not continue? Does the profiled application stop? Since you know that the assertion returns true, it indicates that the assertion method returns. Do you see the "Assert Complete" message in the real-time view?
Best regards,

Andreas Suurkuusk
SciTech Software AB

theney
Posts: 4
Joined: Tue Feb 03, 2009 12:05 am

Post by theney » Tue Feb 03, 2009 4:10 pm

Yes I do expect there to be a problem.
No the comment after the assert does not appear in the realtime graph.
This application opens a file, processes information from the file, then provides a messaging service for the information. In this case, the file is opened (this is the ~ operation ~), but the messaging service functions do not perform. If the assert statement is commented out, then all is well.

Thanks for the prompt reply.

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

Post by Andreas Suurkuusk » Wed Feb 04, 2009 7:46 pm

If you expect to have new live instances, then the first problem is that the NoNewInstances assertion returns true, as that indicates that no new live instances exists. And I don't know why you service get stuck when ending the assertions. I have performed several tests with assertions in a service, but I have not been able to reproduce your problem.

Can you provide some additional information about your service and how you profile it? Are you running from the standalone profiler, within Visual Studio or non-interactive (e.g the console or using the /noui argument)?

What are the "Memory Leak" settings? E.g. is the "Suspend thread until memory leak is handled" option enabled?
Best regards,

Andreas Suurkuusk
SciTech Software AB

theney
Posts: 4
Joined: Tue Feb 03, 2009 12:05 am

Post by theney » Thu Feb 05, 2009 1:14 am

I have run both from standalone and from within VS9 (I like this mode best!).

I have run with options set two different ways:
Ask user ...
Perform actions - Collect .., Start ... (Stop not selected)
In both cases the Suspend thread is Selected.

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

Post by Andreas Suurkuusk » Fri Feb 06, 2009 3:47 pm

Our investigations of this problem has revealed one issue with the assertions, but it's only related to declarative assertions in release builds, so it will probably not affect you.

To get more information about this, it would be very good if you could provide us with log-files from the profiler. Unfortunately, the logging for assertions is very sparse in the current version, so you will need to download the latest build from http://memprofiler.com/MemProfilerInstaller3_1_326.msi (or http://memprofiler.com/MemProfilerInsta ... -64bit.msi). This build also contains the fix for the problem with declarative assertions.

Once you have installed the latest build, the log-files are created by providing the "/log" command line parameter to the profiler executable (e.g. using the Run command and entering "C:\Program files\SciTech\NetMemProfiler3\NetMemProfiler.exe" /log).

This will create three log-files: ProfilerLog.txt, ProfilerClientLog.txt and AssertLog.txt. The log-files will be created in the folder "C:\Users\<User>\AppData\Local\SciTech\MemProfiler3\Logs" (or "C:\Documents and Settings\<User>\Local Settings\Application Data\SciTech\MemProfiler3\Logs" on Windows XP/2003). Since you are running a service, the "ProfilerLog.txt" file and the "AssertLog.txt" file will be created under the AppData folder for the service user. If you are running under the LocalSystem account, the folder will be "C:\Windows\System32\config\systemprofile\AppData\Local\SciTech\MemProfiler3\Logs".

If you manage to create (and find) the log-files, can you please send them to support@scitech.se (preferably zipped).

I'm sorry for the inconvenience. If you have the time to help us with the log-files, that would be much appreciated, as we would like to find out what's causing your problem.
Best regards,

Andreas Suurkuusk
SciTech Software AB

theney
Posts: 4
Joined: Tue Feb 03, 2009 12:05 am

Post by theney » Mon Feb 16, 2009 5:14 pm

Sorry for the late reply. I have found, using your product, the major leak I was looking for, but due to running out of time with the trial, have not been able to do the recommended steps. We are in the purchasing cycle now, and expect to use the product on the sister application to this one. Thank you for your continued support and effort.

Tim Heney

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

Post by Andreas Suurkuusk » Tue Feb 17, 2009 2:36 pm

I'm glad that you managed to find the memory leak you were looking for.

If you need to use the profiler before your purchase is finished, you can request a new 14-day evaluation by sending an e-mail to sales@scitech.se.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests