On 05 Jan 2001 16:35:09 -0800, Hans Bergsten wrote:
> "Scott M. Stirling" wrote:
> > 1. Doesn't it seem a bit sloppy to leave a bunch of classes loaded that
> > will never get dumped unless the server is shutdown? Just a matter of
> > elegance, I suppose.
[Hans Bergsten]
> Yes, it does. But AFAIK there's no way you can just unload a class
> from the JVM; you would have to drop the class loader for the
> context and reload all classes that are still valid. That doesn't
> seem like the right thing to do in this situation IMHO.
It depends how class loading in Tomcat works. I'm familiar with JRun
3.0, which works like this (I'm not giving away any family secrets, this
stuff is documented in various places in Allaire docs):
- servlets & JavaBeans (even those called by JSPs) - loaded by a
classloader with web-app scope. If a single servlet changes, the whole
web-app's classloader is dumped so the servlet can be dynamically
reloaded. No need to actively reload the other classes that got dumped
with the classloader. They'll be reloaded as needed when requests come
in for them.
- JSPs are each loaded in their own classloader. So if a JSP is changed
and reloaded, the old classloader is dumped and a new one created.
JavaBeans are delegated to the web-app classloader, for whatever reason.
All this may change in future versions, when JRun reloads tag handlers
dynamically. I have no idea how Tomcat handles these classloader
issues, but it would be interesting to hear about if anyone can distill
it briefly.
--
Scott Stirling
West Newton, MA
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]