G1GC and finalizer queue

Bernd Eckenfels ecki at zusammenkunft.net
Wed Oct 19 20:39:55 UTC 2016


Hello,

the finalize() is in one of the parent classes.

http://grepcode.com/file/repo1.maven.org/maven2/postgresql/postgresql/9.1-901.jdbc4/org/postgresql/jdbc2/AbstractJdbc2Statement.java#803

I am not sure if youkit shows unreferenced or referenced objects in
"pending finalization". If it is referenced objects, the statements
might hang around in a prepared statement cache. If they are
unreferenced the finalizer thread might be slow or blocked.

I would try to do an heapdump to investigate.

When properly using datasource pools and tomcat facilities a leak is
unlikely. If you have some hardcoded jdbc code, that might also be a
possible explanation for the number.

Gruss
Bernd

 Am Wed, 19 Oct 2016 20:16:01 +0000
schrieb Hongkai Liu <hongkai.liu at ericsson.com>:

> Hi,
> 
> 
> our application (Gerrit) consumes more and more memory and Yourkit
> showed up with 18M
> Jdbc4PreparedStatement<http://grepcode.com/file/repo1.maven.org/maven2/postgresql/postgresql/9.1-901.jdbc4/org/postgresql/jdbc4/Jdbc4PreparedStatement.java>
> objects in "pending finalization" which uses up 21G of mem.
> 
> The heap is taken immediately after two GCs.
> 
> 
> I wonder why those objects survived of GCs.
> 
> According to Yourkit
> doc<https://www.yourkit.com/docs/java/help/reachability.jsp>,  the
> objects in "pending finalization" are from the class with an
> implemenation of finalize() method while
> Jdbc4PreparedStatement<http://grepcode.com/file/repo1.maven.org/maven2/postgresql/postgresql/9.1-901.jdbc4/org/postgresql/jdbc4/Jdbc4PreparedStatement.java>
> is without it.
> 
> Is it about G1GC?
> 
> 
> Any hint is appreciated.
> 
> 
> BR,
> 
> Hongkai
> 
> 
> ================================
> 
> 
> Here are the screenshots of Yourkit and App info.
> 
> [cid:82499a3c-9de5-4ae9-b0f3-c9f2e173aa40]
> 
> [cid:5dd8cdb6-7736-4294-9bc5-698ad47ecf29]
> 
> 



More information about the hotspot-gc-use mailing list