I'm investigating problems related to PermGen saturation on hot redeploy of my web applications. Using jhat I found that the class org.apache.catalina.util.http.ServerCookie has a static reference to my webapp classloader through the log field. This is what jhat shows: Static reference from org.apache.tomcat.util.http.ServerCookie.log (from class org.apache.tomcat.util.http.ServerCookie) : --> org.apache.commons.logging.impl.Log4JLogger@0x66826ed8 (16 bytes) (??:) --> class org.apache.commons.logging.impl.Log4JLogger (84 bytes) (??:) --> org.apache.catalina.loader.WebappClassLoader@0x6632eb38 (152 bytes) It is similar to bug#42172. The problem shows in Tomcat 5.5.25
Same problem with org.apache.jasper.xmlparser.ParserUtils.errorHandler and org.apache.jasper.xmlparser.ParserUtils.entityResolver. Static reference from org.apache.jasper.xmlparser.ParserUtils.errorHandler (from class org.apache.jasper.xmlparser.ParserUtils) : --> org.apache.jasper.xmlparser.MyErrorHandler@0x6657ffb8 (12 bytes) (field log:) --> org.apache.commons.logging.impl.Log4JLogger@0x66580558 (16 bytes) (??:) --> class org.apache.commons.logging.impl.Log4JLogger (84 bytes) (??:) --> org.apache.catalina.loader.WebappClassLoader@0x6632eb38 (152 bytes) Static reference from org.apache.jasper.xmlparser.ParserUtils.entityResolver (from class org.apache.jasper.xmlparser.ParserUtils) : --> org.apache.jasper.xmlparser.MyEntityResolver@0x6657ffc8 (12 bytes) (field log:) --> org.apache.commons.logging.impl.Log4JLogger@0x66580568 (16 bytes) (??:) --> class org.apache.commons.logging.impl.Log4JLogger (84 bytes) (??:) --> org.apache.catalina.loader.WebappClassLoader@0x6632eb38 (152 bytes)
Patch proposed for tc6. If accepted, I'll propose a backport to 5.5.x
Fixed in 6.0.x.
Fixed in 5.5.x and will be included in 5.5.26 onwards.