Hi,
    I have a webapp that has 300 jar files bundled in WEB-INF/lib. Most of
the classes in these jar files need to be loaded during the startup of the
webapp. Does tomcat release the jar file handles once the class loader is
done loading the classes? It does not seem to be the case.
Ideally, tomcat should close the jar file handles that the webapp no longer
needs.

Is there a way to configure tomcat to have an agressive policy to close
unused file handles?
I looked at the tomcat configuration documentation, and did not find any way
to configure this.
The Tomcat version I am using is 5.5.28 and the platform is windows server
2000.

Interestingly, when I looked at Tomcat version 5.5.27 on Linux, the number
of open jar file handles associated with the tomcat process was zero.

Is this behaviour platform specific?

I explored the source code of WebappClassLoader to find that the class
loader periodically tries to free the file handles of jars that are not
being used. (ref :
WebappClassLoader.closeJars()<http://google.com/codesearch/p?hl=en#cM_OVOKybvs/tomcat/tomcat-6/v6.0.10/src/apache-tomcat-6.0.10-src.zip%7CKNqCNnRERSg/apache-tomcat-6.0.10-src/java/org/apache/catalina/loader/WebappClassLoader.java&q=webappclassloader.java&d=11>
)

Any pointers/ suggestions are greatly appreciated!

Thanks in advance,
Vijay

Reply via email to