[Biojava-l] A little (??!!!) stress test.

Thomas Down td2@sanger.ac.uk
Tue, 4 Jul 2000 11:25:58 +0100

On Sun, Jul 02, 2000 at 11:22:24PM +0200, Gerald Loeffler wrote:
> Hi thomas,
> can you please be more more specific about the "trouble" the big
> ArrayList causes?! Does it throw an Out of Memory exception, which could
> be  solved with the -Xmx argument to "java"? Or does it throw any other
> exception? Or does it hang?...

No, nothing like that (well, actually the first time I tried
I /did/ get an OutOfMemoryError, but as you say that's easy to
fix).  The real problem comes with code like:

  int BIG_NUM = 20000000;
  List myList = Collections.nCopies(BIG_NUM, "blah");
  List myListCopy = new ArrayList(myList);

The final like throws a NegativeArraySizeException -- this
must be a bug in the ArrayList copy constructor (not that
it's entirely possible to build an ArrayList of that size
by other means, it's just the copy constructor that causes

Of course, /why/ BioJava was needing to copy the sequence at
all is another question entirely, but I have a fix for that now
(Constructing a SimpleSequence from a SymbolList now delegates
to the SymbolList rather than copying its contents).

Hope this makes things clearer,

He looked up with big brown eyes.  ``They're really only
tiny little A-bombs, honest.''
                                     -- David Brin.