tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 53936] Minimize classloader leaks from stacktrace elements in long-lived Exceptions
Date Sun, 30 Sep 2012 18:57:50 GMT

--- Comment #3 from Timo Kinnunen <> ---
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

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message