A more worthwhile perspective on GC, I think is this:

Compare doing simple string manipulations in C versus in Java.
In C it's hard work, but you can allocate intermediate arrays
statically and program their reuse.  In Java, it's easy (so people tend
to use a lot of string joins etc), and has to be implemented using 
dynamic storage allocation with later collection.  It can't even easily
be inlined because of run-time subclassing (OK it can be done...).

Of course if you rewrote the Java code into C with the same structure,
it would probably be slower because GC is generally faster than explicit
freeing.

Paul Kelly


Reply via email to