Re: Need help with finalization issue.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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/
.



Relevant Pages

  • Re: C++ sucks for games
    ... Just a typo that can be horrendous to ... but if your memory management is scattered and out of control, ... >>implement raii, and i think that's a serious flaw. ... resource - and resource can be anything at all. ...
    (comp.lang.lisp)
  • RFC: Memory Controller
    ... We've seen a lot of discussion lately on the memory controller. ... limit the usage of the resource to the specified value. ... with the specified guarantee of resource availability. ...
    (Linux-Kernel)
  • Re: RAM-CPU Singularity
    ... resource to compensate the urgent needs of another kind of resource. ... That's why the original thinkers came up with the cache stuff: ... It's the same with processors and memory. ... I guess you called "virtual memory" the swap space on disk, ...
    (comp.theory)
  • Re: [ckrm-tech] [RFC][PATCH] UBC: user resource beancounters
    ... kernel memory and virtual memory. ... fair CPU scheduler is not tied to UBC in any regard. ... the infrastructure (for resource management) we ... it is also more logical to have them separate since they ...
    (Linux-Kernel)
  • Re: Linux as resilient as BSD, resource hogging?
    ... >> one particular resource, most of them can be used for all resources. ... I did fully implement a memory controlling ulimit (admittedly ... > causes additional paging. ... > *hog* process would be suspended. ...
    (comp.os.linux.security)