Red Gate forums :: View topic - Winforms app - classes not getting GCd
Return to www.red-gate.com RSS Feed Available

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

Winforms app - classes not getting GCd

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



Joined: 28 Apr 2009
Posts: 4

PostPosted: Tue Apr 28, 2009 5:02 pm    Post subject: Winforms app - classes not getting GCd Reply with quote

In my winforms application, each "form" is actually a usercontrol that is placed in a panel. When the user selects a menu item, the current "form" is removed from the panel and explicitly disposed before newing up the next usercontrol and adding it to the panel's controls collection. Using memory profiling, I see that some of my "forms" aren't going away after calling dispose(). I click GC now and take a snapshot and see that they're still listed in live objects. How can I determine what is preventing it from GC?

thank you
Back to top
View user's profile Send private message
StephenC



Joined: 15 Oct 2007
Posts: 315
Location: Cambridge

PostPosted: Tue Apr 28, 2009 6:22 pm    Post subject: Reply with quote

Hi,

the easiest way would be to try the upcoming V5 which has an 'Object Retention Graph' showing you which other objects are still holding references to an instance you are interested in and therefore preventing garbage collection.

You can try the early access build from here:
http://www.red-gate.com/messageboard/viewforum.php?f=92

There are a set of filters available which you will find very helpful by the sounds of it. One of them checks for objects where Dispose was called but the object is still in memory.

Feedback is very much appreciated on this early access version of V5 if you can spare a few minutes when finished profiling.

Regards,

Stephen
Back to top
View user's profile Send private message
mnadig



Joined: 28 Apr 2009
Posts: 4

PostPosted: Tue Apr 28, 2009 8:08 pm    Post subject: Reply with quote

Thank you for the quick reply. Downloaded and just watched Part 1 on the How to with v5 videos on youtube (in 2 parts). I'm looking forward to Part 2. Meanwhile, I'll give it a go and provide feedback.
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