Summary: | sun.net.www.http.KeepAliveCache preventing classloader from being garbage collected | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Rob Kooper <kooper> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | default | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | patch to jreMemoryLeakPreventionListener to load sun.net.www.http.KeepAliveCache using system classloader |
Thanks for the patch. It has been applied to 7.0.x and will be included in 7.0.1 onwards. I have also proposed the patch for back-port to to 6.0.x IMHO, logging an error if the class is not found might induce some users of non-Sun JVMs in error... an INFO level is probably enough, with a message explaining that it might be normal with some JVMs. I've aligned the patch with how we handle other Sun specific issues for non-Sun JVMs. This has been fixed in 6.0.x and will be included in 6.0.28 onwards. |
Created attachment 25377 [details] patch to jreMemoryLeakPreventionListener to load sun.net.www.http.KeepAliveCache using system classloader When a servlet creates a URLConnection, internally this is done using sun.net.www.http.HttpClient. To have the ability to keep connections alive and close them after a certain time they are placed inside a cache. A static reference is kept to this cache (sun.net.www.http.KeepAliveCache). It seems this cache is never released and the classloader stays in memory. I have a patch to jreMemoryLeakPreventionListener.java that will make sure the KeepAliveCache is loaded by the system classloader and not the webAppClassLoader.