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 0BE243A3C6C for ; Sun, 28 Nov 2004 12:34:49 +0000 (GMT) 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 73550-06 for ; Sun, 28 Nov 2004 12:34:44 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9F77B3A4FC0 for ; Sun, 28 Nov 2004 12:34:45 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CYOG4-0007CW-00; Mon, 29 Nov 2004 01:34:28 +1300 Message-ID: <41A9C70C.9090503@opencloud.com> Date: Mon, 29 Nov 2004 01:39:40 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.9 (X11/20041115) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jonathan.lister@vaisala.com Cc: pgsql-jdbc@postgresql.org Subject: Re: Is there a size limit on setBinaryStream? References: <0077BA604D38D311918B00508B44425802AAEA34@birsrv01.vaisala.com> In-Reply-To: <0077BA604D38D311918B00508B44425802AAEA34@birsrv01.vaisala.com> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; 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: 200411/218 X-Sequence-Number: 11640 jonathan.lister@vaisala.com wrote: > I am using pg74.215.jdbc3.jar [...] > My code is very similar to the example given in the documentation. It > seems to work OK for files up to around 780k, but when I try a larger > file (e.g. 5,498k it seems to just "hang" .. no exception, no error report). I suspect continuous GC is the cause, especially if you're running with a small heap. Try turning on -verbose:gc and see what you get. You will have more success with large binary objects if you use the development driver. The stable driver creates a lot of intermediate representations when you use setBytes() or setBinaryStream(). This means you need perhaps 10-20 times the stream's length in temporary heap space. The development driver streams the data directly, and should only need a small constant-sized intermediate buffer regardless of the stream length. -O