Hi, Absolutely, the jars you used affect "reloadability". Two cases are the classics: - A library you use starts a non-daemon thread, and either doesn't close it or provides some sort of a shutdown method that you're not calling. This thread cannot be closed by Tomcat, so any of its resources (including its classloader by definition) cannot be recycled until the JVM is killed. - A library you use has classes that keep references to static variables that never go out of scope, meaning they can't be recycled, the classes with the references can't be recycled, and the classloader itself can't be recycled.
Two things are therefore encouraged: - Design your app / architecture such that the need for reloads in production is rare, - Find which libraries do either of the above things, notify the vendor, and get on their case to fix it. There's also the obvious, ever-present advice, but it bears repeating: if a library you use provides methods to shutdown, always use them. For example, Log4j's LogManager#shutdown and Commons-Logging LogFactory#release/releaseAll methods. Both are rarely used ;( Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Anthony E. Carlos [mailto:[EMAIL PROTECTED] >Sent: Monday, September 20, 2004 11:52 PM >To: [EMAIL PROTECTED] >Subject: Do the jars I use affect webapp reloadability? > >Hello, > >I'm experiencing a memory problem that is documented in >http://jakarta.apache.org/tomcat/faq/deployment.html at the bottom. >When I redeploy a web app, a 12MB chunk of memory gets taken by the >JVM. After a few redeployments, I get an OutOfMemory error. The faq >mentioned above blames it on the Classloader not being able to be >recycled. I know that I can increase the size of the memory, but that >isn't the real solution because eventually I'm going to have to restart >Tomcat to reclaim the lost memory. > >My question is, do the jars I'm using affect the reloadability of a web >app so that the Classloader cannot be recycled? I suspect this because >as soon as I add a few jars to my apps, I start experiencing this >phenomenon. I have a suspicion that it is OJB or the Oracle JDBC >drivers, but I don't have any empirical data. Do you know of any jars >that specifically cause this? Is there anything that can be done to >ensure that the Classloader can be recycled (thus allowing me to >redeploy web apps without wasting memory)? > >Thanks, > >-Anthony Carlos > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
