Red Gate forums :: View topic - take a snapshot after a program is closed
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

take a snapshot after a program is closed

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Arseny



Joined: 07 Jul 2011
Posts: 2

PostPosted: Thu Jul 07, 2011 10:15 am    Post subject: take a snapshot after a program is closed Reply with quote

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.
Back to top
View user's profile Send private message
Laura Morley



Joined: 22 Jun 2011
Posts: 34
Location: Red Gate Software

PostPosted: Mon Jul 11, 2011 1:02 pm    Post subject: Reply with quote

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"?
Back to top
View user's profile Send private message
Arseny



Joined: 07 Jul 2011
Posts: 2

PostPosted: Tue Jul 12, 2011 11:19 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Laura Morley



Joined: 22 Jun 2011
Posts: 34
Location: Red Gate Software

PostPosted: Tue Jul 12, 2011 2:25 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group