Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2011, 12:09 PM
Registered User
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Garbage Collection Question

Hi,
If I have a class A that implements IDisposable,
and I have a data member Class B,
I implement Dispose() and GC.SuppressFinalize(Me) in Class A
but don't call B.Dispose() explicitly in Class A not even in the Finalizer
Did I releases the memory for B or
do I need explicitly call B.Dispose() so memory is explicitly released for B ?
Does anybody have an idea if the memory for B is still allocated for the application even though the Class A no longer exists?
Is there a quick test I can run to confirm if there is a memory leak in the application due to Class B ?
Just as a side note, the application is written in VB.
Any ideas or response you may have is greatly appreciated.
Thanks.

-V-
 
Old March 21st, 2011, 02:21 AM
Registered User
 
Join Date: May 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to samdoss Send a message via Yahoo to samdoss
Default Garbage collection

Hi,

You are in class A. How can you GC.SuppressFinalize(Me). Me innocent current Class. Where is the object for Class B.
The Following User Says Thank You to samdoss For This Useful Post:
StarDrago (November 17th, 2011)
 
Old November 17th, 2011, 12:33 PM
Registered User
 
Join Date: Nov 2011
Posts: 4
Thanks: 5
Thanked 0 Times in 0 Posts
Default

What have you done in order to detect leaks? What tools did you use?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbage Collection azizur123 .NET Framework 2.0 1 February 3rd, 2008 11:16 AM
garbage collection generalization tapan General .NET 2 April 27th, 2007 07:13 AM
Garbage Collection... kk_katepally General .NET 1 December 21st, 2004 04:18 AM
garbage collection can't work? gkb Pro PHP 1 July 31st, 2003 02:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.