Title: Message Title
|
|
|
org.jibx.binding.classes.ClassCache uses a static field to store references to the files that are put on the classpath for the binding compiler.
The problem is that this field is never cleaned up. In standalone mode of the compiler this is not a problem as the VM the classes exist in is terminated more or less immediately.
This however changes, if the corresonding binding compile ant task is used. Since the ant VM is a long living process, the aforementioned resource leaks causes all members of the classpath that were given to the ant task to be locked until the VM terminates. By "locked" I mean, that at least a file handle is kept. In UNIXoid systems this might be less critical as these system tend to cope better with open file handles to files that are touched in a writing fashion (e.g. move/rename, or open for R/W in general). On Windows systems at least however this becomes a problem for the surrounding build process, as it is no longer able to update/move/delete the files that the references are being held to. Short example snippet from our build process:
<bind load="true"> <classpath> <pathelement location="${build.classes.dir}" /> <path refid="build.classpath" /> </classpath> <bindingfileset dir="${jibx.binding.dir}"> <include name="*binding.xml" /> </bindingfileset> </bind>
With the above example, at least all jar files that are part of the refered "build.classpath" will be locked after this call.
The current workaround is to call the <bind> task immediately afterwards again, with an empty classpath element. This effectively removes the references to the java.io.File's from ClassCache's member. Garbage collection than takes care of the rest.
In case somebody stumbles across this, here's the aforementioned workaround in a target that you can call after every bind task usage.
<!-- JiBX Binding Compiler task leaks file references. Use this call with an empty classpath to clean up after use of the bind task --> <target name="jibx-fix-fileleaks"> <bind load="false"> <classpath/> <bindingfileset dir="."> <include name="dummy.xml" /> </bindingfileset> </bind> </target>
|
|
|
|
|
|
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs