X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 199925E46DB for ; Fri, 20 Aug 2004 06:46:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33112-09 for ; Fri, 20 Aug 2004 09:46:31 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 2C6905E46C0 for ; Fri, 20 Aug 2004 06:46:29 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1By5ye-0001US-00; Fri, 20 Aug 2004 21:46:28 +1200 Message-ID: <4125C871.1070608@opencloud.com> Date: Fri, 20 Aug 2004 21:46:25 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Mikko T." Cc: pgsql-jdbc@postgresql.org Subject: Re: OutOfMemory when inserting stream of unknown length References: <41251B4C.9020205@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/114 X-Sequence-Number: 10836 Mikko T. wrote: > But now the current implementation forces the user of the > setBinaryStream to buffer all bytes to memory just to know how many > bytes the stream will actually hold. And after that it can already call > setBytes thus making the whole setBinaryStream useless when the stream > length is not known beforehand. Not true -- consider the case where you know the length but the data is held out of heap (for example, a large NIO buffer or a file on disk). -O