Red Gate forums :: View topic - Application.Forms holding forms from releasing
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

Application.Forms holding forms from releasing

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



Joined: 10 Feb 2011
Posts: 1

PostPosted: Thu Feb 10, 2011 7:24 am    Post subject: Application.Forms holding forms from releasing Reply with quote

I am running into an issue with the winforms getting cleared.

I have a custom base form inheriting from System.Windows.Forms.Form. All the forms that i create are inheriting from my custom base form. After profiling my application for memory leaks i find that some of the pop-ups are not getting released. These pop-ups are still held in memory because of Application.Forms. How should this be cleaned up?

Thanks in advance.
Back to top
View user's profile Send private message
melvyn.harbour



Joined: 15 Mar 2010
Posts: 28

PostPosted: Thu Feb 10, 2011 10:54 am    Post subject: Reply with quote

I suggest that you examine one of the instances (forms) using the Instance Retention Graph:

http://www.red-gate.com/supportcenter/Content?p=ANTS%20Memory%20Profiler&c=ANTS_Memory_Profiler/help/7.0/amp_5_retention.htm&toc=ANTS_Memory_Profiler/help/7.0/toc1286233.htm

You then need to examine the path to GC root to determine where a reference is being held incorrectly. Commonly this could be something like you forgetting to release a reference to the form in an event handler. If you break the references, garbage collection should then be able to take care of the rest.

Mel
_________________
Melvyn Harbour
Project Manager
.NET Tools Division
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