Re: JDBC driver's (non-)handling of InputStream:s

From: Guido Fiala <guido(dot)fiala(at)dka-gmbh(dot)de>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC driver's (non-)handling of InputStream:s
Date: 2004-03-31 08:52:01
Message-ID: 200403311046.17224.guido.fiala@dka-gmbh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>> It would be great if you could supply a test case which exhibits this
>> behaviour.
>
>I can probably do that relatively easily (though of course subject to the
>behavior of the VM memory manager), though given Oliver Jowett's response
it
>seems pretty obvious what is happening - allocating a 5 MB byte array is
>failing and/or the byte array is constructed in a tight loop allocating
>incrementally larger arrays until the data fits.

It's slightly more "intelligent" - see code...

>Allocating such large arrays is bound to be unreliable in any case, so as
long
>as that is what's happening I fully understand it and there's probably not
>much to be done...

Thats true so long the consumer needs the data fully in RAM, e.g. an
Image-Label or similar. If the consumer is also stream-based it could be
avoided. Unfortunately the backend would still hold the results of the query
fully in memory which is also not always desired...

Guido

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jeff Amiel 2004-03-31 10:08:39 Re: what is lslowing me down? JDBC or Postgresql itself?
Previous Message Guido Fiala 2004-03-31 08:51:36 Re: OutOfMemory