When redeploying applications in Tomcat/Glassfish/JBoss/etc it is easy to cause a classloader leak by keeping a reference to an instance from a previous classloader. Jevgeni Kabanov discusses this issue here...
http://www.zeroturnaround.com/blog/reloading-objects-classes-classloaders/
Has anybody found a good way to harness automated testing (ie: via junit) to test that redeploying your web application does not cause memory leaks? I have been wondering if perhaps using embedded Jetty would make it easy to write a junit test that re-deploys your application over and over and over again.