You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/02/19 17:46:22 UTC
DO NOT REPLY [Bug 6550] New: -
Old WebappClassLoaders can't be GC'd. Not all references removed.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6550>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6550
Old WebappClassLoaders can't be GC'd. Not all references removed.
Summary: Old WebappClassLoaders can't be GC'd. Not all references
removed.
Product: Tomcat 4
Version: 4.0.2 Final
Platform: All
URL: http://nyx.obidobi.net/~thomas/tomcat/index.html
OS/Version: All
Status: UNCONFIRMED
Severity: Normal
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: thomas@obidobi.net
I had a memory leak when using Tomcats manager to reload my application.
Analyzing the situation i found that Singeltons are never GC'd. Why? Looking
deeper there seems to be a problem with old WebappClassLoaders never getting
GC'd and the reason seems to be that there are references to the
WebappClassLoaders that never get removed.
See here for more information:
<http://nyx.obidobi.net/~thomas/tomcat/index.html>
I have located the problem to:
static Hashtables (clBindings, clNameBindings ) located in class
org.apache.naming.ContextBindings.
The classLoaders are added to these Hashtables by a call from
lifecycleEvent in the class NamingContextListner.java
=============
NamingContextListner.java, 295
if (container instanceof Context) {
// Setting the context in read only mode
ContextAccessController.setReadOnly(getName());
try {
ContextBindings.bindClassLoader
(container, container,
((Container)
container).getLoader().getClassLoader());
} catch (NamingException e) {
log(sm.getString("naming.bindFailed", e));
}
}
============
I think that there should be a call to unbindClassLoader somewhere in NamingContextListner.java, method lifecycleEvent
ContextBindings.unbindClassLoader( container, container );
Thomas
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>