take a snapshot after a program is closed

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

take a snapshot after a program is closed

Postby Arseny » Thu Jul 07, 2011 10:15 am

Hi,
I installed a trail version of ANTS Memory Profiler 7.0
I try to run the profiler from VS2010. when I start the profiler it launches my program and i can take snapshots during the program work within seconds.
what I cannot to do is to take a snapshot AFTER I close my program. In this case the snapshot is being generated for ages. what I want to do is to see memoryleaks after my program is closed.
Arseny
 
Posts: 2
Joined: Thu Jul 07, 2011 10:05 am

Postby Laura Morley » Mon Jul 11, 2011 1:02 pm

Hi Arseny.

In theory, it's not possible to use ANTS Memory Profiler (AMP) to take memory snapshots after the application you're profiling has closed - at least, not after the process in which the application runs has closed. When that process terminates, all the memory it uses is returned to Windows, and there should be nothing for ANTS to capture in a snapshot. If your application has a UI component that you can close without terminating the process itself, you'll still be able to take snapshots, but you won't be able to do so after the application has really closed.

But the way you describe your problem makes me wonder if something more complicated is going on. When the process you're profiling terminates, that should make AMP's "Take Memory Snapshot" (and the "Stop Profiling" button) unavailable (it should become greyed out). If t this button is still available after you believe the application has closed, it may be that something else is going on - a crash or a hang in the application you're profiling, for example.

Can you tell us a bit more about the application you're profiling, the environment you're working in, and what happens after you click "Take Memory Snapshot"?
Laura Morley
 
Posts: 34
Joined: Wed Jun 22, 2011 2:13 pm
Location: Red Gate Software

Postby Arseny » Tue Jul 12, 2011 11:19 am

Hi Laura.
I only want to check if any memory leaks occur. I think I can check this after my app. is closed. How can I do it?
Arseny
 
Posts: 2
Joined: Thu Jul 07, 2011 10:05 am

Postby Laura Morley » Tue Jul 12, 2011 2:25 pm

Hi Arseny.

After an application has closed, no, it's not possible to get a snapshot of the memory that application used, and therefore not possible to look for memory leaks in that application. (When the process closes, it stops leaking memory, and returns the memory it was using to Windows; ANTS can't take a snapshot because the application's memory has been released.) Just to be clear, AMP is profiling the memory used by just one process (the one your application runs in), not the total memory used on the computer.

If you want to see whether your application is leaking memory just before you close it, you can simply run the program to the point where you would normally close it, take the snapshot, wait for the snapshot to finish returning results, and then close the application. You can then continue viewing the results after the application you were profiling is closed.

We have a walkthrough guide to finding and fixing memory leaks here.

Does any of this help?
Laura Morley
 
Posts: 34
Joined: Wed Jun 22, 2011 2:13 pm
Location: Red Gate Software


Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 1 guest