Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: OutofMemoryException Pin
Ian Grech20-Apr-08 23:24
Ian Grech20-Apr-08 23:24 
GeneralRe: OutofMemoryException Pin
Jordanwb21-Apr-08 2:39
Jordanwb21-Apr-08 2:39 
GeneralRe: OutofMemoryException Pin
Scott Dorman22-Apr-08 16:58
professionalScott Dorman22-Apr-08 16:58 
GeneralSystem.CodeDom Problem. Pin
hdv21219-Apr-08 22:55
hdv21219-Apr-08 22:55 
GeneralRe: System.CodeDom Problem. Pin
Rob Smiley20-Apr-08 0:46
Rob Smiley20-Apr-08 0:46 
GeneralUnable to fill certain fields inside the DOM of some websites! Pin
alon198019-Apr-08 21:50
alon198019-Apr-08 21:50 
GeneralRe: Unable to fill certain fields inside the DOM of some websites! Pin
alon198021-Apr-08 4:36
alon198021-Apr-08 4:36 
GeneralFinalizer implementation Pin
George_George19-Apr-08 21:20
George_George19-Apr-08 21:20 
Hello everyone,


Two conflicting points about how to implement Finalizer, which one is correct?

1.

I always heard from people that in Finalizer we should not refer to any other objects, since the order of Finalizer is non-determistic, means the referred object in Finalizer might not alive any more.

2.

From the following article from MSDN, seems we are safe to refer to any wrapped objects (in my understanding, it means referring to member variables in Finalizer is always safe)?

http://msdn2.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2

--------------------
"How Finalization Affects Collection
When the garbage collector first encounters an object that is otherwise dead but still needs to be finalized it must abandon its attempt to reclaim the space for that object at that time. The object is instead added to a list of objects needing finalization and, furthermore, the collector must then ensure that all of the pointers within the object remain valid until finalization is complete.
....
Since the internal object pointers must remain valid, not only will the objects directly needing finalization linger in memory but everything the object refers to, directly and indirectly, will also remain in memory. If a huge tree of objects was anchored by a single object that required finalization, then the entire tree would linger, potentially for a long time as we just discussed."
--------------------


thanks in advance,
George
GeneralRe: Finalizer implementation Pin
Scott Dorman20-Apr-08 4:57
professionalScott Dorman20-Apr-08 4:57 
GeneralRe: Finalizer implementation Pin
carbon_golem20-Apr-08 5:29
carbon_golem20-Apr-08 5:29 
GeneralRe: Finalizer implementation Pin
George_George20-Apr-08 17:38
George_George20-Apr-08 17:38 
GeneralRe: Finalizer implementation Pin
carbon_golem21-Apr-08 1:53
carbon_golem21-Apr-08 1:53 
GeneralRe: Finalizer implementation Pin
George_George21-Apr-08 2:07
George_George21-Apr-08 2:07 
GeneralRe: Finalizer implementation Pin
carbon_golem21-Apr-08 6:32
carbon_golem21-Apr-08 6:32 
GeneralRe: Finalizer implementation Pin
George_George21-Apr-08 21:49
George_George21-Apr-08 21:49 
GeneralRe: Finalizer implementation Pin
carbon_golem22-Apr-08 2:39
carbon_golem22-Apr-08 2:39 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 3:04
George_George22-Apr-08 3:04 
GeneralRe: Finalizer implementation Pin
George_George20-Apr-08 19:02
George_George20-Apr-08 19:02 
GeneralRe: Finalizer implementation Pin
Scott Dorman22-Apr-08 17:13
professionalScott Dorman22-Apr-08 17:13 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 17:20
George_George22-Apr-08 17:20 
GeneralRe: Finalizer implementation Pin
Scott Dorman22-Apr-08 17:36
professionalScott Dorman22-Apr-08 17:36 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 17:47
George_George22-Apr-08 17:47 
GeneralRe: Finalizer implementation Pin
Scott Dorman23-Apr-08 2:15
professionalScott Dorman23-Apr-08 2:15 
GeneralRe: Finalizer implementation Pin
George_George23-Apr-08 2:49
George_George23-Apr-08 2:49 
Generalroot in managed heap Pin
George_George19-Apr-08 21:01
George_George19-Apr-08 21:01 

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.