TagHandlerPool is slow when I ran stress test my web application using tomcat7. It occured in 7.0.19. Profiler said that it causes are followings: 1. Lock of log instance at org.apache.jasper.runtime.TagHandlerPool. 2. Lock of parameters field at org.apache.catalina.core.StandardWrapper.getInitParameter. An attached patch resolve this issue in my environment. It makes following changes: 1. Makes log field to static. 2. At StandardWrapper, changes lock policy from synchronized block to ReentrantReadWriteLock.
Created attachment 27851 [details] Reduce lock patch
The lock changes look good to me. The log change needed more careful checked. I have vague recollections of memory leaks with Jasper and logging and a number of components using non-static loggers to avoid them. Having checked the initialisation sequence, the logger is created by the container class loader, not a web app class loader so that change should be fine to. I'll commit these changes shortly.
Many thanks for the patch. It has been applied to trunk and 7.0.x and will be in 7.0.23 onwards.
Created attachment 27862 [details] 2011-10-29_tc6_52091_StandardWrapper.patch TC6 patch for StandardWrapper - backport of r1190389
Thanks for applying all changes! Followings are changesets of this ticket for my reminder: r1190388, r1190389
Fixed in 6.0 and will be in 6.0.34. r1200268 and r1200269