https://issues.apache.org/bugzilla/show_bug.cgi?id=51195

--- Comment #1 from Christopher Schultz <ch...@christopherschultz.net> 
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
implementation.

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

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to