From: Jesper Thorhauge <jth@conzentrate.com>
To: pgsql-jdbc@postgresql.org
Subject: getBinaryStream and OutOfMemoryException
Date: Tue, 28 Jun 2005 10:15:31 +0200
Message-ID: <42C10723.5010702@conzentrate.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: jth@conzentrate.com
Subject: Re: getBinaryStream and OutOfMemoryException
In-Reply-To: <42C10723.5010702@conzentrate.com>
References: <42C10723.5010702@conzentrate.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox