Peter's option is a valid one.  I use this approach myself to limit the
size of PermGen.  Of course, I may have more control over the apps than
you do. If you do need to load different version, you should be able to
put the alternate version in the apps WEB-INF/lib directory and the
app's loader will prefer it. (at least at 5.5).
One thing to watch out for.  Some libraries do not "play nice".  For
instance, log4j gets instantiated once for the jvm.  If you share the
lg4j library but each app has its own log file definition, they will end
up meshing into one log (I think the last one instantiated).

Jeff

-----Original Message-----
From: Peter Crowther [mailto:peter.crowt...@melandra.com] 
Sent: Thursday, May 28, 2009 4:03 AM
To: 'Tomcat Users List'
Subject: RE: MaxPermSize, Tomcat startup trouble


By the way, there's one other thing you *could* try if you had to reduce
memory usage.  I don't like it, because it makes versioning the webapps
a nightmare; but it might save you quite a lot of RAM and allow you to
go live on the current hardware.  The choice is yours!

If many of your webapps use the same versions of the same jars, you
*could* share them between webapps.  The classes will then be loaded
once, rather than once per webapp, reducing the amount of PermGen
required.  The problem, of course, is that your webapps are then locked
to the same library versions - updating one webapp with a new library is
a problem.

If you want to look at this approach, check the Tomcat 6 classloader
how-to on the web site.  But if you do this, I would suggest you regard
it as an emergency hack and look urgently at ways to remove it.

                - Peter

*******************************  NOTICE  *********************************
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to