Red Gate forums :: View topic - Finding leaks between memory snapshots
Return to www.red-gate.com RSS Feed Available

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

Finding leaks between memory snapshots

Search in ANTS Memory Profiler Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
tzunoi



Joined: 03 Nov 2010
Posts: 2

PostPosted: Wed Nov 03, 2010 6:00 pm    Post subject: Finding leaks between memory snapshots Reply with quote

Hi,

Supposing the following scenario:
C# .NET application that has some iterations.
- after I run iteration 1 I do a snapshot - S1.
- I run iteration 2, here some (not all of them - leak) object from iteration 1 should be destroyed (should not be referred anymore) and new ones are created. When it finish I do a memory snapshot - S2.
- I run iteration 3 and some object previously created at iteration 2 are destroyed - not all of them that's the funny part - and new ones are created. This new ones are not destroyed until the end of iteration - and should not be. After iteration 3 ends, I take a memory snapshot - S3.

Idea is that object allocated in previous iteration are destroyed in current ones and I can do snapshots only between iteration - otherwise will be something messy. Also, there are a lot of objects so tracing them by hand is not an option.

Now if I compare S3 with S2 I see all object allocated (ans should be allocated) but also old one that are not destroyed.
I need some kind of object allocated into iteration one (I1) and not destroyed into I2 and object allocated into I2 and not destroyed in I3.

Any idea how could I do this?

By the - way it takes so long to buy a license...I order it 1 week ago and still I don't have serial number.
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Thu Nov 04, 2010 12:24 pm    Post subject: Reply with quote

Hi,

It looks like the 'survivors in growing classes' filter that we've added in v7 of the profiler may do some of what you need. The new categorisation view in the class graph may help as well.

You can get the EA build of version 7 here: http://www.red-gate.com/MessageBoard/viewforum.php?f=134

From your description, one possibility is that the objects you're having problems with have finalizers (or they are referenced by something with a finallizer, a UI control perhaps). These will cause them to survive at least one garbage collection, and potentially very many if finalizable objects reference each other (in the profiler this will look like they gradually disappear over the course of many snapshots).

The zombie object filter might be worth checking out as well: this will show you any objects that were going to be finalized in the earlier snapshot but haven't been removed in the later snapshot - this can be sign of poor finalizer code that creates new references to the object, forcing it to stay in memory. It can also be a sign of slow finalizer code, which will limit the rate at which .NET can remove the objects.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
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