Re: Memory leaks using refcursors - Mailing list pgsql-jdbc

From Guillaume Smet
Subject Re: Memory leaks using refcursors
Date
Msg-id 1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com
Whole thread Raw
In response to Memory leaks using refcursors  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Responses Re: Memory leaks using refcursors
List pgsql-jdbc
Just a post to answer to the question of Dave Cramer on IRC and have a
comprehensive thread:
23:07 <dcramer> how would it know the cursor was open ?

AFAICS there's code in the driver to deal with the refcursor,
especially to get the cursor name and fetch all the results to a
result set.
Isn't there a way to keep the cursor name and close it automatically
when the statement or the resulting result set is closed?

I don't see an easy way to do it in the application directly (but any
tip is welcome) and ISTM it should be dealt by the driver directly to
prevent the memory usage of the backend growing dramatically during
the transaction.

--
Guillaume

pgsql-jdbc by date:

Previous
From: "Guillaume Smet"
Date:
Subject: Memory leaks using refcursors
Next
From: Tom Lane
Date:
Subject: Re: Memory leaks using refcursors