Re: Garbage Collector!!!! is it required

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Wood (j_at_ro.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 09:02:03 -0400

No the garbage collector is certainly less overhead than manual heap
deallocation in most cases. Consider a loop where you might allocate and
deallocate memory say 100,000 times. The GC will likely defer any
deallocation until after that loop is complete, thus reducing the overhead
of unnecessary memory management during the loop itself.

There's nothing unreliable about the GC. In fact, you can *rely* on it
deallocating memory eventually, where-as if you forget about allocation
under a heap-managed program then it'll just be a dangling reference and
will become a memory leak.

The GC knows about the state of memory consumption in the process as a
whole, and can optimize its operations accordingly. It employs sophisticated
algorithms to determine which memory deallocations should have priority,
which can often save a signficant number clock-cycles in critical sections
of code.

You can find plenty on the web about how the GC works if you really have a
problem trusting it. In my experience (and I'm sure I share this with
others), it's certainly not a burden in any way, quite the opposite.

-- 
John Wood
EMail: first name, dot, last name, at priorganize.com
"breathedotnet" <breathedotnet@discussions.microsoft.com> wrote in message
news:3A7FA550-538B-4ED1-964D-124379DB83CE@microsoft.com...
> C++ had a delete operator for every new one created. .Net says i would do
that job but why do we need some backend unreliable process to do it when u
cud have done it.
> It is just a overhead
> -- 
> Do not mistake that i am crazy bout .net it is just that it is filled with
so many bugs that it ends up in u cleaning up the mess day and night.
>
> And hence u breathe .net all the time.


Relevant Pages

  • Re: How to clear Memory Log
    ... The PDT article in the MPE 5.0 Communicator: ... Chapter 10 Technical Articles Memory Page Deallocation Steve Flynn Systems Technology Division MPD and Current Systems This article presents an overview of Memory Page Deallocation, ... HP's current memory design is single-bit correct, ...
    (comp.sys.hp.mpe)
  • Re: How to clear Memory Log
    ... When diagmond restarts the memlogd process, if the memlog file does not exists it should be created. ... Now STM tells me the memory log is empty. ... The PDT article in the MPE 5.0 Communicator: ... Chapter 10 Technical Articles Memory Page Deallocation Steve Flynn ...
    (comp.sys.hp.mpe)
  • Re: How to clear Memory Log
    ... How to clear Memory Log ... The PDT article in the MPE 5.0 Communicator: ... Chapter 10 Technical Articles Memory Page Deallocation Steve Flynn ...
    (comp.sys.hp.mpe)
  • Re: How to clear Memory Log
    ... How to clear Memory Log ... The PDT article in the MPE 5.0 Communicator: ... Chapter 10 Technical Articles Memory Page Deallocation Steve Flynn ...
    (comp.sys.hp.mpe)
  • Re: How to clear Memory Log
    ... Now STM tells me the memory log is empty. ... The PDT article in the MPE 5.0 Communicator: ... Chapter 10 Technical Articles Memory Page Deallocation Steve Flynn ... MEMLOGP, ...
    (comp.sys.hp.mpe)