Summary: | performance (classloader?) problems with signed jars in WEB-INF/lib | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | ole.schulz-hildebrandt |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.0.17 | ||
Target Milestone: | ---- | ||
Hardware: | PC | ||
OS: | Linux |
Description
ole.schulz-hildebrandt
2015-01-21 08:56:05 UTC
8MB+ will be too big for a Bugzilla attachment but if you can put the file somewhere I can download it, a web application that reproduces this issue would be much appreciated. I put an example application signedjar.war here: https://drive.google.com/file/d/0By0Iea2JkjtKdlI2SGFSaVg2ZWs/view?pli=1 I can confirm that it is JAR verification that is causing the slow down. The way to avoid that is to keep the JAR open for the life of the web application. However, that causes a catch-22 problem. Keeping the files open will prevent the web application from being deleted. If the web application can't be deleted folks that undeploy that way won;t be able to so the web application can't be stopped (which would be the trigger to close the file). I need to think about the best way to fix this. Maybe a ThreadLocal list of JARs to close? Presumably, the ClassLoader is going to load a whole bunch of classes from these JAR files at once; probably the first time some feature/group of classes is used. When a request is completed, maybe we could tell the WebappClassLoader that the request is done and it can close any JAR files it opened during that request, rather than having it re-open the JAR each time it loads a class. That is sort of what Tomcat 7 does. I think I can port the openJars / closeJars from Tomcat 7's WebappClassLoader to Tomcat 8's resources implementation. This has been fixed in trunk and 8.0.x and will be included in 8.0.19 onwards. Thank you! :) thanks for the fast fix of this issue :-) Startup with tomcat 8.0.x trunk is as fast as tomcat 7 now. Do I have to close this bug or is that done by you? |