From: Oliver Jowett <oliver@opencloud.com>
To: Sharib Anis <sharib.anis@wilabs.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Postgresql 7.4.2 and OutOfMemoryError
Date: Tue, 01 Jun 2004 12:38:42 +1200
Message-ID: <40BBD012.9070809@opencloud.com> (raw)
In-Reply-To: <005001c44304$c75ede70$1864000a@SHARIB>
References: <005001c44304$c75ede70$1864000a@SHARIB>
Sharib Anis wrote:
> Hello All,
>
> I'm using Postgresql for our java application. I started with Postgres
> 7.2.1 and everything worked fine. Then however, I decided to upgrade to
> 7.4.2.
>
> Since then I'm facing this frustrating problem where I'm always getting
> OutOfMemoryError. Basically there is an operation which involves
> inserts/updates in batches of 20K records. With the earlier version of
> Postgresql and driver, it worked smoothly, but not now. Any ideas why?
> What should I do to overcome this? I'm using the latest 7.4 driver too.
> I suspect it's an issue with the driver.
20k sounds high for batch updates. The driver has to keep the batched
statements in memory until executeBatch(). Lowering the batch size may
help. I find that, over a 100mb network, there's little-to-no benefit
from batch sizes above 100 (@ 1k data per insert), even when the driver
is really doing batching (which the current driver doesn't do).
If you don't mind trying a very-experimental driver I have a version
with substantial improvements to bytea support & batch updates waiting
in the wings. I've seen a 5-fold speedup (and drastic reduction in
memory use) of a microbenchmark that does batch inserts of bytea data.
Let me know if you'd like to try that driver.
(I'm looking for testers if any other adventurous people want to try it
out..)
-O
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: oliver@opencloud.com, sharib.anis@wilabs.com
Subject: Re: Postgresql 7.4.2 and OutOfMemoryError
In-Reply-To: <40BBD012.9070809@opencloud.com>
References: <005001c44304$c75ede70$1864000a@SHARIB> <40BBD012.9070809@opencloud.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