Re: IDisposable with managed code
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 18 Jan 2007 11:54:19 -0800
Mark wrote:
If your class implements IDisposable, I was told that this increases the
speed with which your class is garbage collected. Is this true?
No, it is not true. IDisposable allows you some control over when
non-memory resources are released: file locks, memory allocated outside
the managed environment, handles to resources in the underlying O/S,
etc. IDisposable has no effect upon when the GC will reclaim memory.
If you have just released a very large memory structure and want to
hasten its collection, you should call GC.Collect(), but even this does
not guarantee immediate cleanup, it just makes it more likely.
.
- References:
- IDisposable with managed code
- From: Mark
- IDisposable with managed code
- Prev by Date: IDisposable with managed code
- Next by Date: Launch an app on logoff?
- Previous by thread: IDisposable with managed code
- Next by thread: Launch an app on logoff?
- Index(es):
Relevant Pages
|