Re: Prepared statement leak - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Prepared statement leak
Date
Msg-id 4432F421.2030402@opencloud.com
Whole thread Raw
In response to Prepared statement leak  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-jdbc
Peter Eisentraut wrote:
> We seem to have identified a prepared statement leak in the JDBC driver.  The
> actual application runs through Hibernate, so we have attempted to isolate
> the problem here.  In the field, the problem causes the PostgreSQL server to
> run out of memory in linear time.

If you force a full GC on the Java side (i.e. call System.gc()), does
the driver clean up those leaked statements on the next query? In
theory, if the driver leaks references to a server-side prepared
statement it should reclaim the server statements when weak references
next get collected, which may take some time if the Java side is not
generating much garbage (weak references only get collected on a full
GC). Obviously we don't want to leak them in the first place, but I put
that mechanism in place in case we did.

-O

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: No Primary Keys (pg7.4.2 on SLES9)
Next
From: Kris Jurka
Date:
Subject: Re: Prepared statement leak