[Biojava-l] Java Resource Management [a semi troll...]

Ewan Birney birney at ebi.ac.uk
Mon Feb 10 18:00:17 EST 2003



On Mon, 10 Feb 2003, Bill Torcaso wrote:

>
> 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.

Often my programs will probe the machine (harder than you think) or by
provided by the user with a memory size. The algorithm will then use all
the memory (via malloc).


I agree with you that for people who are used to it, C malloc/free is not
so bad (in particular when valgrind is around...) but I have to admit that
garbage collection is generally a good thing. What I don't like is
unnecessary hidden overhead in libraries/and or runtime.


But... I am clearly very comfortable in C, and not in Java, so... just
interested to hear how people handle the version churn and memory aspects
of JVMs






More information about the Biojava-l mailing list