-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

Caldarale, Charles R wrote:
>> From: David Delbecq [mailto:[EMAIL PROTECTED] 
>> Subject: Preventing memory leaks with awt event thread, is it 
>> possible?
>>
>> 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).
> 
> Perhaps you could declare a <Listener> class under <Server> that
> initializes AWT.  This should run independently of any webapp.

Other things to consider are:

1. How often you actually use the AWT
2. How often you hot-re-deploy your webapp

For instance, if you hardly ever use the AWT, then perhaps you should
have an external process that handles this operation. You could maybe
use a batch job, or even spawn a command-line program that does your
dirty work.

If you use the AWT a lot, perhaps an "AWT server" is what you need...
sprinkle a little localhost-only TCP/IP into a separate process that
runs independently of Tomcat. This could be a long-running process that
eats up only its own memory and not that of your webapp.

Finally, if you hardly ever hot-re-deploy your webapp, I just wouldn't
worry too much. For exmaple, whenever we upgrade our apps in production,
we shut down Tomcat and the JVM entirely, load the new code, and start
back up. In that case, the re-deploy scenario isn't an issue (even if
it's true that re-deploying "wastes" memory).

Personally, I would be leery of running an AWT instance within a
production webapp, simply due to the memory and CPU consumption issues
it raises. I'm sure that it's way more stable than it used to be, but
it's hairier than the hashtables-and-JDBC world of the standard webapp.
Just my two cents.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFU7x/9CaO5/Lv0PARAoQqAJ9dDZyVRq+tlJL21y0tWo7YbjVcdACfakG4
fiZmOVBfTqTfe79V7S4NJNw=
=Gz8X
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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