This is a frequently asked question. There are several discussions of this exact topic on this list. Have you read the archives?
I have observed, and reported (in this forum), that up to 3 contexts may be referenced at a given time. Sometimes more, but more then 3 will (eventually) get GC'd. See http://marc.theaimsgroup.com/?l=tomcat-user&m=114001512903342&w=2 Tim -----Original Message----- From: Mark Shifman [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 12:35 PM To: Tomcat Users List Subject: undeploy/deploy memory leak Hi: I am using tomcat 5.5.16 , struts 1.2.9, jstl , castor and a bunch of stuff from jakarta commons. I can watch my perm gen memory fill up with jconsole when I deploy->run for a while -> undeploy->deploy..... I have read the wiki page http://wiki.apache.org/tomcat/OutOfMemory and I am not using (as far as I know) the singleton pattern. I have implemented a ServletContextListner http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?page Id=2669 that 1. Introspector.flushCaches(); 2. ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); LogFactory.release(contextClassLoader); http://wiki.apache.org/jakarta-commons/Logging/UndeployMemoryLeak?action=pri nt 3. for (Enumeration e = DriverManager.getDrivers(); e.hasMoreElements();) { Driver driver = (Driver) e.nextElement(); if (driver.getClass().getClassLoader() == getClass().getClassLoader()) { DriverManager.deregisterDriver(driver); } } presumably to get rid for jdbc drivers. My common/lib contains both commons-logging.jar and log4j-1.2.8.jar. These are also in myapp/WEB-INF-lib. Is this somehow a problem not permitting release of classloaders? Is there some other evil pattern that I am using that causes memory to leak ? Is there basically a problem deploying-> undeploying->deploying in general? mas --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]