Garbage Collector!!!! is it required

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
breathedotnet said:
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.

Personally I find machines more reliable than my own coding.
It is just a overhead

In some cases, it's actually *less* of an overhead, all told, because
allocation in a GC system is very simple - it's just moving a pointer,
basically.

The GC is part of .NET, and you can't get rid of it.
 
breathedotnet said:
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

Yes, and why trust a backend unreliable compiler in the first place, when we
could all do it in x86 machine code?
In fact: Why trust an unreliable CPU in the first place, when pen and paper
could (in theory) do the same job!?
so many bugs that it ends up in u cleaning up the mess day and night.

Which one, for example?
C++ compilers used to be "filled with bugs" too, however I rarely ever
stumbled over one, so it was still mit productive than coding in plain C.
And hence u breathe .net all the time.

Maybe you should get a firm understanding of the .net framework before you
can give serious suggestions.

Niki
 
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 said:
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
so many bugs that it ends up in u cleaning up the mess day and night.
 
breathedotnet said:
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

Have you every wasted many hours trying to track down a memory leak??
 
breathedotnet said:
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.

funny, the whole reason managed code came about was to save the unreliable human from the painstaking manual memory allocation/deallocation. obviously it wasn't as big of a problem for you as the rest of us. :)
 
a phrase involving the words 'hit', 'nail', 'on' and 'head' comes to
mind....


Yes, and why trust a backend unreliable compiler in the first place, when we
could all do it in x86 machine code?
In fact: Why trust an unreliable CPU in the first place, when pen and paper
could (in theory) do the same job!?
with
so many bugs that it ends up in u cleaning up the mess day and night.

Which one, for example?
C++ compilers used to be "filled with bugs" too, however I rarely ever
stumbled over one, so it was still mit productive than coding in plain C.
And hence u breathe .net all the time.

Maybe you should get a firm understanding of the .net framework before you
can give serious suggestions.

Niki
 
Back
Top