Re: Prepared statement leak

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Prepared statement leak
Date: 2006-04-04 22:33:05
Message-ID: 4432F421.2030402@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2006-04-04 22:35:03 Re: Prepared statement leak
Previous Message Kris Jurka 2006-04-04 21:34:11 Re: No Primary Keys (pg7.4.2 on SLES9)