[Biojava-dev] BioJava 1.7.1 SimpleRichObjectBuilder memory issue

Bart Mesuere bart.mesuere at ugent.be
Mon Dec 6 11:06:34 UTC 2010


Hi,

While reading and digesting 10GB of GenBank files, I noticed the
SimpleRichObjectBuilder keeps a reference to every Object it created.
I know this is done to preserve the singleton property of the objects
but it wastes a lot of memory.
Shouldn't it be better to keep these references in a weak valued HashMap?
That way when no other references to the object exists, the object
(and key) can be collected by the garbage collector.
I wrote a basic implementation of such a RichObjectBuilder and it
seems to work fine.
I was wondering if I overlooked something because I would be happy to
contribute the code (if this is still an issue in the upcoming
BioJava3 release).

Kind regards,
Bart

--
Bart Mesuere
Department of Applied Mathematics and Computer Science
Ghent University



More information about the biojava-dev mailing list