DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30362>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30362

Tomcat eats up file handers





------- Additional Comments From [EMAIL PROTECTED]  2004-07-30 08:55 -------
Thanks for the lsof hint. 
I analyzed the situation on a different machine and first thing was really the 
huge amount of open files from Tomcat uses. This must have been an issue 
already in the past, cause I found the comment:
        // Close all JARs right away to avoid always opening a peak number 
        // of files on startup
        if (getLoader() instanceof WebappLoader) {
            ((WebappLoader) getLoader()).closeJARs(true);
        }
(StandardContext.java). Nevertheless this seems to be the only point where open 
jar-files are closed, later on they might reopened and onle be closed if a 
webapp will stop() (btw: there the try-catch is inside the for-loop). On the 
machine we have normally 7 Webapps and 1763 open handles reported by lsof to 
jar files. The same jar files are opened up to 40 times according to lsof, 
sorry to say so, but I don't think this is necessary and is messing up with 
system resources. On the test machine we often deploy new versions and then we 
come to the ulimit limits sometimes (also sometimes we see a "Failed to close 
JAR" error, which leads to additional unclosed and forgotten jars).
I would like to make a patch which will do two things:
-> reduce the amount of open handles to same file, by using a global jar-file 
cache such that jar-fiels with same path are opened only once.
-> restrict the number of parallel open handles by using an LRU-Cache for the 
global cache (e.g. hard limit to 500).
Since this might affect design issues, I would like to get a comment about 
this, before start programming it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to