Re: Memory leaks using refcursors

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
Cc: "PostgreSQL JDBC" <pgsql-jdbc(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Memory leaks using refcursors
Date: 2007-01-19 14:59:35
Message-ID: 127FFFA1-CF4F-4CC5-A6EA-23442E2E0C69@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Guilluame

On 19-Jan-07, at 8:26 AM, Guillaume Smet wrote:

> Hi Dave,
>
> On 1/19/07, Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
>> I've asked Guillaume to test this hypothesis with his test case that
>> does not use XA to see if the memory "leak" still exists without XA
>
> Perhaps I was not clear when I explained the remaining problem. I
> don't have any memory leak left. The attached file is a test case
> which shows the new problem.

You were exceptionally clear when you described the problem you are
now having. Apparently I have not been clear.

I don't believe the solution is for the result set to close the
unnamed portal when it is closed. As you can see there is a catch-22
situation which you described clearly.

I believe the problem is in the server's XA code somehow not closing
unnamed parameters properly.

If you could run the code I sent you and tell me if it causes a leak,
then that will confirm it.

Dave

>
> The commit is done before closing the resultset and so the close()
> method can't find the portal which results in an exception (the portal
> is closed on commit).
> It's probably not something we should do but before there was no error
> in this case and now it throws an exception which is not really clear
> for the end user:
> An exception has occured.ERROR: cursor "<unnamed portal 1>" does
> not exist
> org.postgresql.util.PSQLException: ERROR: cursor "<unnamed portal 1>"
> does not exist
>
> --
> Guillaume
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Guillaume Smet 2007-01-19 16:07:22 Re: Memory leaks using refcursors
Previous Message Guillaume Smet 2007-01-19 13:28:08 Re: Memory leaks using refcursors