Re: Garbage Collection - The Trash Begins To Pile Up
Le Chaud Lapin wrote:
Yet, when a programmer
uses the GC model, they might experience the following problems:
* An OutOfMemoryException is thrown.
* The process is using too much memory for no obvious reason that
you can determine.
* It appears that garbage collection is not cleaning up objects
fast enough.
* The managed heap is overly fragmented.
* The application is excessively using the CPU.
All of these symptoms make me wary, but the second (*) is most
impressive... "for no obvious reason that you can determine". The
last word in this sentence, "determine", is closely related to another
word, "determinism", a feature of C++ that is probably the basis for
having never experienced any of these problems in C++.
In comparison, the typical memory problems of a C++ program are far
more serious: memory leaks, heap corruption, memory "stomping", invalid
output, "crashes" far removed from the site of the error - the variety
of potential C++ memory-management errors is practically infinite, and
uniformly disasterous.
Unless C++ is intended to become a programming language exclusively for
hobbyists and others who write programs for their own enjoyment - then
the C++ language has to evolve from its 80s-era origins if it is to
remain economically competitive as a programming language today.
Fortunately, the C++ committee can read the writing on the wall as well
as anyone: manual memory management is far too error-prone, produces
programs that are far too expensive to debug and maintain, and even
fails to deliver on the type safety guarantees of the language itself,
to be presented as a serious alternative to automated memory
management.
C++ without any form of automated memory management cannot be taken
seriously as a commercial-grade computer programming language today,
and even less so, tomorrow.
Greg
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]