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

Re: Memory leaks using refcursors

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>, "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-18 01:25:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

The driver ends up issuing a

fetch all in  <unnamed portal 1>

which if I try to close gives an error

cursor "<unnamed portal 1>" does not exist

so my guess is the portal is gone... what else might be keeping  
server memory ???

I thought about this and long running transactions and if this were  
really a problem slony would certainly blow up, as it has  
transactions that run days.

On 17-Jan-07, at 5:31 PM, Tom Lane wrote:

> "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com> writes:
>> Isn't there a way to keep the cursor name and close it automatically
>> when the statement or the resulting result set is closed?
> 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?
> 			regards, tom lane
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 6: explain analyze is your friend

In response to

pgsql-jdbc by date

Next:From: Todd ShoemakerDate: 2007-01-18 14:05:42
Subject: Default numeric scale of zero in JDBC?
Previous:From: Guillaume SmetDate: 2007-01-17 23:27:53
Subject: Re: Memory leaks using refcursors

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