Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Dispose and InitializeComponent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Harris - 27 Sep 2007 16:49 GMT
Theoretically, are there ever any cases or known defects where you should
have to do any of the following to objects created by the designer inside of
InitializeComponent()?  

1 - call dispose() on an object
2 - set to null an object
3 - Manually tear down an event

I'm having a dickens of a time tracking down a memory bleed.  I can reduce
the severity of the bleed by adding the above statements into the Dispose()
functions.  I'm sure that by doing this I'm making sections of the graphed
memory unreachable so the GC reclaims it - just haven't figured out what
connection to the whole isn't getting severed yet.

I'm using the SciTech .NET memory profiler so I know the bleed is real.  
Unfortunatlely it isn't following the reference links back to something
useful - they go back to Object [] which goes back to root

Thanks.
Laura T. - 27 Sep 2007 17:35 GMT
> Theoretically, are there ever any cases or known defects where you should
> have to do any of the following to objects created by the designer inside
[quoted text clipped - 4 lines]
> 2 - set to null an object
> 3 - Manually tear down an event

None as far as I know.

> I'm having a dickens of a time tracking down a memory bleed.  I can reduce
> the severity of the bleed by adding the above statements into the
[quoted text clipped - 8 lines]
>
> Thanks.

Track'em down with windbg. It's harder but more "fun".
Here's a how to: http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.