cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessio Soldano <>
Subject On finalize() potential issues
Date Tue, 07 Oct 2014 09:11:34 GMT
some of you might already be aware that the finalize mechanism in the 
JVM is basically flawed and there could be issues even when it's used 
for commonly accepted reasons (like cleaning up stuff that the user 
forgot about). A very interesting presentation has been recently made 
available on this topic, I suggest having a look at .
This said, it's many months (possibly years) since I started seeing 
infrequent transient failures in the JBossWS <-> Apache CXF integration 
testsuite, usually caused by "Socket closed" 
exceptions (here is an example, To be honest, I have no 
proof this is actually related to the finalize() topic above, but I'm 
wondering if anybody here ever seriously considered the potential issue.
We do have a finalize() method in the ClientProxy, which calls the 
close() method which in turn calls ClientImpl's destroy() method. That 
goes through multiple cleanup things, including shutting down the 
Conduit, which is always based on URLConnection in my case. To give an 
idea of the kind of issues, before you have a look at the presentation, 
especially on highly optimized JDK, the finalize method might end up 
being called when the resources it's meant to cleanup are still being used.
Any thoughts?

Alessio Soldano
Web Service Lead, JBoss

View raw message