Re: Need help with finalization issue.
- From: Barry Kelly <barry.j.kelly@xxxxxxxxx>
- Date: Sat, 02 Sep 2006 15:52:29 +0100
John wrote:
The GC doesn't seem to realize that it needs to unload some of this
stuff because the objects seem to have much smaller memory footprints
than they actually do
BTW, this is the reason for GC.AddMemoryPressure() and
GC.RemoveMemoryPressure() in .NET 2. You have to tell the GC in your
constructor / reallocate / finalize methods.
and even if the GC did know how big they are it
doesn't understand that there are seperate memory resource pools.
Also
calling GC::Collect() doesn't seem to be cleaning them up either.
I'm not sure exactly what this refers to: do you mean that your objects
are being kept alive from somewhere? Or does it mean that you haven't
implemented finalization on your objects properly?
FWIW, manual resource management hasn't gone away. When the resource
isn't managed memory, you've still got to do it yourself, using
IDisposable, 'using', C++/CLI & smart pointers & RAII, etc. To get good
performance in a number of scenarios I've found it necessary to reinvent
the memory allocator etc. YMMV.
-- Barry
--
http://barrkel.blogspot.com/
.
- References:
- Need help with finalization issue.
- From: John
- Re: Need help with finalization issue.
- From: Jon Shemitz
- Re: Need help with finalization issue.
- From: John
- Need help with finalization issue.
- Prev by Date: Re: Need help with finalization issue.
- Next by Date: Re: Need help with finalization issue.
- Previous by thread: Re: Need help with finalization issue.
- Next by thread: Re: Need help with finalization issue.
- Index(es):
Relevant Pages
|