Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 238359FB2AC for ; Wed, 17 Jan 2007 21:25:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 73289-06 for ; Wed, 17 Jan 2007 21:25:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id A8A939FB2A3 for ; Wed, 17 Jan 2007 21:25:17 -0400 (AST) Received: (qmail 8090 invoked from network); 18 Jan 2007 01:25:16 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.14?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 18 Jan 2007 01:25:16 -0000 In-Reply-To: <6135.1169073075@sss.pgh.pa.us> References: <1d4e0c10701171053t55e60a2epf3e395b5b97101b5@mail.gmail.com> <1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com> <6135.1169073075@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: multipart/alternative; boundary=Apple-Mail-28--349702496 Message-Id: <283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com> Cc: "Guillaume Smet" , "PostgreSQL JDBC" , thierry.buffet@fr.nurun.com From: Dave Cramer Subject: Re: Memory leaks using refcursors Date: Wed, 17 Jan 2007 20:25:42 -0500 To: Tom Lane X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/114 X-Sequence-Number: 16479 --Apple-Mail-28--349702496 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Tom, The driver ends up issuing a fetch all in which if I try to close gives an error cursor "" 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. Dave On 17-Jan-07, at 5:31 PM, Tom Lane wrote: > "Guillaume Smet" 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 > --Apple-Mail-28--349702496 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Tom,

The driver ends up issuing = a=A0

fetch = all in=A0 <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.

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

"Guillaume Smet" <guillaume.smet@gmail.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.=A0 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.=A0 What queries are you = executing?

regards, tom lane

TIP 6: = explain analyze is your friend


= --Apple-Mail-28--349702496--