Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6F8579FB537 for ; Thu, 19 Jul 2007 09:34:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 42918-05 for ; Thu, 19 Jul 2007 09:33:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 176CA9FB52B for ; Thu, 19 Jul 2007 09:34:01 -0300 (ADT) Received: (qmail 14918 invoked by uid 1112); 19 Jul 2007 12:34:00 -0000 Date: Thu, 19 Jul 2007 08:34:00 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: roman cc: pgsql-jdbc@postgresql.org Subject: Re: Using bytea with ResultSet.getBytes("..."). Problem. Help!! In-Reply-To: <003001c7c9bc$1da75a50$5405a8c0@nnp.nsk.su> Message-ID: References: <003001c7c9bc$1da75a50$5405a8c0@nnp.nsk.su> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/91 X-Sequence-Number: 17265 On Thu, 19 Jul 2007, roman wrote: > I have a problem with reading big binary data from BYTEA field. I write > to it about 16MB pdf file (as byte[] array) sucessfully, but when I try > to read it back I have an exception: > > Exception occurred during event dispatching: > java.lang.OutOfMemoryError: Java heap space > at org.postgresql.util.PGbytea.toBytes(PGbytea.java:53) You don't mention what driver version you are using, but 8.2-504 and higher will be slightly stingier about the amount of memory it uses. You still need a lot of memory to retrieve large results, but this version is better. Kris Jurka