Skip site navigation (1) Skip section navigation (2)

Re: Memory leaks using refcursors

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL JDBC" <pgsql-jdbc(at)postgresql(dot)org>, thierry(dot)buffet(at)fr(dot)nurun(dot)com
Subject: Re: Memory leaks using refcursors
Date: 2007-01-17 23:27:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi Tom,

On 1/17/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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: 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.


In response to


pgsql-jdbc by date

Next:From: Dave CramerDate: 2007-01-18 01:25:42
Subject: Re: Memory leaks using refcursors
Previous:From: Tom LaneDate: 2007-01-17 22:31:15
Subject: Re: Memory leaks using refcursors

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group