G1GC and finalizer queue

Vitaly Davidovich vitalyd at gmail.com
Wed Oct 19 21:52:09 UTC 2016


On Wednesday, October 19, 2016, Bernd Eckenfels <ecki at zusammenkunft.net>
wrote:

> 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.

YK docs indicate it's showing (strongly) unreachable objects that are
sitting on the finalization queue.  This implies (unless YK is broken)
these instances have already been discovered by G1 to be unreachable, and
thus got enqueued for finalization.

I'd jstack/sigquit the Java process to get a thread dump and see what the
Finalizer thread is up to.

>
> 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 <javascript:;>>:
>
> > 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]
> >
> >
>
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net <javascript:;>
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>


-- 
Sent from my phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20161019/5b6bc220/attachment.html>


More information about the hotspot-gc-use mailing list