Click here to Skip to main content
15,895,192 members
Home / Discussions / C#
   

C#

 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 21:32
N a v a n e e t h23-Oct-07 21:32 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
lmoelleb23-Oct-07 22:45
lmoelleb23-Oct-07 22:45 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 23:01
N a v a n e e t h23-Oct-07 23:01 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
Scott Dorman24-Oct-07 1:18
professionalScott Dorman24-Oct-07 1:18 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
Scott Dorman24-Oct-07 1:19
professionalScott Dorman24-Oct-07 1:19 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
Scott Dorman24-Oct-07 1:36
professionalScott Dorman24-Oct-07 1:36 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
lmoelleb24-Oct-07 2:35
lmoelleb24-Oct-07 2:35 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
Scott Dorman24-Oct-07 12:46
professionalScott Dorman24-Oct-07 12:46 
lmoelleb wrote:
With regards to calling Dispose(false) from the finalizer, I stole the idea from these guys: MSDN[^]


I see where this could be confusing. The example they are providing is for implementing a base class that also implements a finalizer. In this scenario, you should make the call to Dispose(false from the finalizer of the base class, but the derived classes should not have their own finalizer or public Dispose() method. The derived classes should only override the Dispose(bool disposing) method.

lmoelleb wrote:
Just out of curiosity - who should ever call Dispose(false) if not the finalizer?


Off hand, I can't think of anything.

lmoelleb wrote:
With regards to promotion, here is one of the sources confirming this (they might be wrong, but I have no reason to doubt them): MSDN Magazine[^].


I am very familiar with this article, and Jeffery Richter is one of the primary people responsible for the GC implementation in .NET. I did find the statement you are referring to where he clearly states:

Finalizable objects get promoted to older generations, which increases memory pressure and prevents the object's memory from being collected when the garbage collector determines the object is garbage. In addition, all objects referred to directly or indirectly by this object get promoted as well.


In that respect, I don't think the finalization queue management is much more significant than longer living objects, but the whole idea behind the GC is that, ideally, you want to have as few long lived objects as possible.


Scott.

—In just two days, tomorrow will be yesterday.

[Forum Guidelines] [Articles] [Blog]

GeneralRe: Removing refrences or objects ? Garbage collector Pin
Scott Dorman24-Oct-07 1:22
professionalScott Dorman24-Oct-07 1:22 
Questionupdate from combobo to textbox Pin
kabutar23-Oct-07 19:54
kabutar23-Oct-07 19:54 
AnswerRe: update from combobo to textbox Pin
Christian Graus23-Oct-07 20:02
protectorChristian Graus23-Oct-07 20:02 
GeneralRe: update from combobo to textbox Pin
kabutar23-Oct-07 20:07
kabutar23-Oct-07 20:07 
Questioninsertion of nature of comment row. [modified] Pin
alok217123-Oct-07 19:43
alok217123-Oct-07 19:43 
AnswerRe: insertion of nature of comment row. Pin
Christian Graus23-Oct-07 19:51
protectorChristian Graus23-Oct-07 19:51 
AnswerRe: insertion of nature of comment row. Pin
N a v a n e e t h23-Oct-07 19:53
N a v a n e e t h23-Oct-07 19:53 
AnswerRe: insertion of nature of comment row. Pin
Guffa23-Oct-07 20:26
Guffa23-Oct-07 20:26 
QuestionHow to show current progress and progress bar..? Pin
Pankaj - Joshi23-Oct-07 19:36
Pankaj - Joshi23-Oct-07 19:36 
AnswerRe: How to show current progress and progress bar..? Pin
Christian Graus23-Oct-07 19:56
protectorChristian Graus23-Oct-07 19:56 
AnswerRe: How to show current progress and progress bar..? Pin
Abhijit Jana23-Oct-07 21:25
professionalAbhijit Jana23-Oct-07 21:25 
QuestionFinding Address of the labels back ground image Pin
sindhutiwari23-Oct-07 19:18
sindhutiwari23-Oct-07 19:18 
QuestionHow to sign digital certificate using vs.net 2005 IDE... Pin
Pankaj - Joshi23-Oct-07 18:41
Pankaj - Joshi23-Oct-07 18:41 
QuestionHow to add home page in start menu...? Pin
Pankaj - Joshi23-Oct-07 18:34
Pankaj - Joshi23-Oct-07 18:34 
AnswerRe: How to add home page in start menu...? Pin
N a v a n e e t h23-Oct-07 18:44
N a v a n e e t h23-Oct-07 18:44 
GeneralRe: How to add home page in start menu...? Pin
Pankaj - Joshi23-Oct-07 18:47
Pankaj - Joshi23-Oct-07 18:47 
GeneralRe: How to add home page in start menu...? Pin
N a v a n e e t h23-Oct-07 18:54
N a v a n e e t h23-Oct-07 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.