The cost of finalize in .Net

Posted by Jules on Stack Overflow See other posts from Stack Overflow or by Jules
Published on 2010-06-15T13:55:10Z Indexed on 2010/06/15 14:02 UTC
Read the original article Hit count: 212

Filed under:
|
|
|
|

(1) I've read a lot of questions about IDisposable where the answers recommend not using Finalize unless you really need to because of the process time involved.
What I haven't seen is how much this cost is and how often it's paid. Every millisecond? second? hour, day etc.

(2) Also, it seems to me that Finalize is handy when its not always known if an object can be disposed. For instance, the framework font class. A control can't dispose of it because it doesn't know if the font is shared. The font is usually created at design time so the user won't know to dispose it, therefore finalize kicks in to finally get rid of it when there are no references left. Is that a correct impression?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET