Skip site navigation (1) Skip section navigation (2)

non-trivial finalize() on AbstractJdbc2Statement

From: Imran <imranbohoran(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: non-trivial finalize() on AbstractJdbc2Statement
Date: 2012-02-10 17:39:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

We've been having OOM errors in our applications through GC overhead limits
under heave load resources running queries. Inspecting the heap dump, it
appears that the finalizer queue is taken up most of the heap space. Almost
all of the the finalizer objects I've seen seem to have a
jdbc3PreparedStatement object in it. Going through the source code of the
driver I see that the 'AbstractJdbc2Statement' has a non-trivial finalize
method. I guess this explains why these objects end up in the finalizer
queue. Can I clarify the need to having this finalize() method here? It
seems to be calling the close() method of the statement which I would have
thought is the responsibility of the client building a Statement object. Is
there any chance this can be dropped so we don't see these objects ending
up in the finalizer queue under heavy load and the jvm running out of
memory before the GC threads gets around to 'actually' reclaim the memory?

Also we are using postgres 9.0.4 and the 8.3-604.jdbc3 version of the
postgresql jdbc driver.

-- Imran


pgsql-jdbc by date

Next:From: Steven SchlanskerDate: 2012-02-10 18:09:27
Subject: Re: GIT move
Previous:From: Florent GuillaumeDate: 2012-02-10 13:19:02
Subject: Re: GIT move

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group