Hello,

playing with a webapplication that requires awt to do some graphical
operation, i noticed this.

1) Servlet invoked by http-thread 69 request an awt operation
2) AWT initializes and starts it's awt event queue thread.
3) As part of the thread initialisation process, the contextClassLoader
of the AWT event queue thread is set as the one of the calling thread,
that is the one of http-thread 69, which has been set by tomcat to
webappClassLoaderXXX
4) undeploy webapp.

At this moment, because the awt event queue won't stop until jvm stops,
the webappClassLoaderXXX stays referenced until the  terminaison of the
java process, which mean every class and static fields are not garbage
collected. If the webapp had a memory footprint of 35M, there are 35M
stuck in java memory.

Is there a way to avoid this? One possibility could be to arrange for
awt thread to run in the context class loader of tomcat server, not the
one of a web application, but then you have to find some way to force
tomcat into initializing awt (and not the first webapp that requires awt).

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to