On Thu, 31 Jan 2002, James Pope wrote: > Date: Thu, 31 Jan 2002 10:21:28 -0000 > From: James Pope <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > To: Tomcat Users List <[EMAIL PROTECTED]> > Subject: Tomcat 4.0.1: Manager web-app hangs on web-app reload request > > Hello, > > I've been having some trouble with Tomcat 4.0.1's Manager web-app, that > I think is related to memory issues... I noticed that when I used the > Manager web-app to reload one of my web-apps (using the > /manager/reload?path=/mywebapp request), Tomcat's memory footprint went > up by about a MB each time - as if garbage collection wasn't happening?
When you reload a webapp, Tomcat throws away all of its references to the entire class loader used to load that webapp, and therefore to all objects created by those classes. As long as your application doesn't maintain any references to objects created by the "old" class loader (such as from a class installed in $CATALINA_HOME/lib), then the old stuff is available for garbage collection. However, if a reference is maintained somewhere, then the old objects are *not* garbage (because there are live references), so they cannot be collected. > > I spoke with some of our local Java "Gurus" and they suggested it might > be that garbage collection doesn't happen until Tomcat reaches it's max > memory allocation space (64 MB by default on Windows?). To test this, I > used Manager to reload my web-app about 20 times in a row, watching > Tomcat's memory footprint go up by about a MB each time, until it got to > just under 70,000 KB (according to Windows XP's Task Manager's Processes > tab), at which point Tomcat appeared to freeze when I tried issuing > another request to the Manager web-app. > > The localhost_log.XXX.txt file informs me that: > > 2002-01-31 09:56:10 Manager: restart: Reloading web application at > '/website' > 2002-01-31 09:56:10 StandardContext[/website]: Reloading this Context > has started > > But nothing more... even in any of the other logs. > > I've tried this a couple of times, with the same result, at the same > memory footprint. > > Has anyone else encountered this problem, or have any ideas as to why > this is happening? > > (I've tried calling System.gc() in the contextDestroyed method of my > ContextListener, after setting the current context = null, but still no > joy...) > > Hoping to hear from someone soon ^_^ > Another possible area of difficulties during a reload is the Tomcat feature that it tries to save and restore your current sessions (and all of the session attributes, if they imlement Serializable). If you have problems serializing or deserializing these objects, you could cause difficulties -- there will be messages and stack traces in the log files if this is happening to you. > -- James Pope > Craig -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
