X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 67DF611F6622 for ; Tue, 4 Apr 2006 19:33:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56812-02 for ; Tue, 4 Apr 2006 19:33:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 5021511F65C9 for ; Tue, 4 Apr 2006 19:33:11 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FQu5C-0006Tq-9r; Wed, 05 Apr 2006 10:33:06 +1200 Message-ID: <4432F421.2030402@opencloud.com> Date: Wed, 05 Apr 2006 10:33:05 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051009) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Eisentraut CC: pgsql-jdbc@postgresql.org Subject: Re: Prepared statement leak References: <200604041538.14171.peter_e@gmx.net> In-Reply-To: <200604041538.14171.peter_e@gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200604/41 X-Sequence-Number: 14975 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