[Biojava-l] Java Resource Management [a semi troll...]
Bill Torcaso
btorcaso at genomecorp.com
Mon Feb 10 12:48:45 EST 2003
Ewan,
As an old-time C programmer who never learned C++ but is very happy with Java, I have a question about your comment, "my algorithms try to use all the memory of the machine". What do you do about malloc() and free()? It seems to me that the most significant part of the "contract" between elements in a C program is the discipline regarding the calls to free(), and the best-written programs have clear and sensible rules about when that happens. It is an essential part of writing a component to be used by someone other than the author/team that created it.
In Java, the worry about free() has disappeared, and some quasi-nameless worry about object creation, or object-lifetime management, gets called performance or JVM weaknesses or someting else [all of which are real issues in their own arena].
But I think I hear in your comments an underlying unease about the heap being out of your control. Is that on target? If so, what would address it? If not, then never mind.
-- Bill Torcaso
p.s. At the first seminar I attended on Java, back in '97, the presenter was working the crowd and asked what the most common source of bugs in C programs was. He was looking for "bad pointers" as a way of touting garbage collection. But I jumped in with this answer: "Bad programmers".
More information about the Biojava-l
mailing list