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 A39345299F for ; Tue, 28 Jun 2005 05:15:39 -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 59447-07 for ; Tue, 28 Jun 2005 08:15:36 +0000 (GMT) Received: from weber.conzentrate.int (0x55513365.adsl.cybercity.dk [85.81.51.101]) by svr1.postgresql.org (Postfix) with ESMTP id 609D4528AD for ; Tue, 28 Jun 2005 05:15:31 -0300 (ADT) Received: from [10.10.100.110] (helo=[10.10.100.110]) by weber.conzentrate.int with esmtp (Exim 4.43) id 1DnBFa-000386-Gy for pgsql-jdbc@postgresql.org; Tue, 28 Jun 2005 10:15:22 +0200 Message-ID: <42C10723.5010702@conzentrate.com> Date: Tue, 28 Jun 2005 10:15:31 +0200 From: Jesper Thorhauge User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: getBinaryStream and OutOfMemoryException 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.335 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/138 X-Sequence-Number: 13100 Hi I have a problem when retreiving relative large files from a bytea field in the database using getBinaryStream. ResultSet res.... InputStream is = res.getBinaryStream("largefile_bytea"); causes OutOfMemoryException... setBinaryStream also used to cause this problem but seems to be fixed with the 8.0-release of the jdbc driver ( thanks!!! :-) ). Whenever i use getBinaryStream on a file of size 9mb or larger it runs out of memory. I know i can just raise jvm heap using -Xmx, but it seems to me like the streaming feature doesn't work properly. Looking into the cvs checkout from 22-05-2005, it really seems to me that getBinaryStream is nothing more than a getBytes ...?? Searching the mailing list archive didn't give me the answer, so i hope someone out there is able to provide it. My setup is; - postgresql-8.0-311.jdbc3 driver - postgresql 8.0 - jboss/tomcat using hibernate - running on windows xp with jdk 1.5.0_02-b09 Regards Jesper Thorhauge