tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51195] "Find leaks" reports a false positive memory/classloader leak
Date Mon, 16 May 2011 21:54:00 GMT

--- Comment #1 from Christopher Schultz <> 2011-05-16 21:54:00
UTC ---
The patch as written seems a bit over-reaching, possibly non-threadsafe and
might even be JVM-specific.

It's over-reaching in that it purges the ObjectStreamClass's cache
unconditionally which may result in a slight performance degradation for other
threads as they re-populate the cache. I suspect performance is somewhat less
of a concern for the thread taking the webapp out of service, so I think
there's a reasonable amount of room to only clear those classes from the cache
that came from the doomed webapp's ClassLoader.

>From a thread-safety point of view, I'm not sure it's safe at all to clear this
cache without doing a lot of checking of the type and/or method signatures,
etc. This is also tied to the fact that this is a private class that may or may
not exist outside of Sun/Oracle's implementation, or even in different versions
of the JVM... if it's implementation-specific, we need a reliable way to test
for the safety of this technique.

Obviously reflection can be used to see if the class and it's fields actually
exist, but I'm skeptical about ensuring the thread-safety of the

Is it not enough to call System.gc(), here?

Configure bugmail:
------- 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