tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53936] Minimize classloader leaks from stacktrace elements in long-lived Exceptions
Date Sun, 30 Sep 2012 18:57:50 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53936

--- Comment #3 from Timo Kinnunen <timo.kinnunen@gmail.com> ---
1) Yes, this is correct. containerOnlyFill(Throwable) is a straight-up Java 1.6
port of the Java 1.7 bootclassLoaderOnlyFill(Throwable) method. 

The 1.6 version could be simplified for production use in Tomcat. Please note,
however, that the same simplification couldn't be applied to the 1.7 version,
because the classes created by java.lang.invoke.MethodHandles can remain in
memory for a long time. An array is used to prevent these classes from holding
a direct reference to the Throwable and keeping it and its ClassLoader from
being garbage-collected.

2) The intended use of this code is for the WebappClassLoader to clean up
Exceptions that are created and held by third-party libraries included in a
webapp when the webapp is unloaded. 

The 1.7 version is also intended to be usable from user code when the developer
of the webapp is aware of one of their libraries having this issue. In this
case the developer can use reflection to get the Exception object held by a
library and call bootclassLoaderOnlyFill(Throwable) on it during
initialization.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message