pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Guillaume Smet <guillaume.smet@gmail.com>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Cc: thierry.buffet@fr.nurun.com
Subject: Re: Memory leaks using refcursors
Date: Wed, 17 Jan 2007 20:25:42 -0500
Message-ID: <283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com> (raw)
In-Reply-To: <6135.1169073075@sss.pgh.pa.us>
References: <1d4e0c10701171053t55e60a2epf3e395b5b97101b5@mail.gmail.com>
	<1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com>
	<6135.1169073075@sss.pgh.pa.us>

Tom,

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.

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.  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
>

view thread (16+ messages)  latest in thread

Message-ID: <283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com>
Permalink:  ../283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com/
Also on:    postgresql.org/message-id/283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com

 · 

reply

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: pg@fastcrypt.com, tgl@sss.pgh.pa.us, guillaume.smet@gmail.com, thierry.buffet@fr.nurun.com
  Subject: Re: Memory leaks using refcursors
  In-Reply-To: <283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.com>
  References: <1d4e0c10701171053t55e60a2epf3e395b5b97101b5@mail.gmail.com> <1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com> <6135.1169073075@sss.pgh.pa.us> <283BFCEF-8CA2-4955-A64F-39E94F2882F3@fastcrypt.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