Re: Memory leaks using refcursors - Mailing list pgsql-jdbc

From Guillaume Smet
Subject Re: Memory leaks using refcursors
Date
Msg-id 1d4e0c10701171527u744fd81eh6de7908599349af3@mail.gmail.com
Whole thread Raw
In response to Re: Memory leaks using refcursors  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Hi Tom,

On 1/17/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> While I agree that the driver probably should do that, I'm not sure why
> you are having a problem.  A cursor doesn't normally accumulate its
> result set in memory on the backend side, so I wouldn't have expected
> all that big a memory leak.  What queries are you executing?

I don't know exactly how much queries are executed during this
transaction but it's a lot of queries and they are _all_ executed
through stored proc returning cursors.

The self contained test case is available here:
http://people.openwide.fr/~gsmet/postgresql/refcursor_problem/ and
especially the stored proc is in the readme file along with all the
instructions to run the test case.

I just run a test case with 10k iterations and the backend which
executes the queries uses 236 MB of memory before the commit.

--
Guillaume

pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Memory leaks using refcursors
Next
From: Dave Cramer
Date:
Subject: Re: Memory leaks using refcursors