This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Shared Java Libraries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Shared Java Libraries" Watch "Shared Java Libraries" New topic
Author

Shared Java Libraries

Kerry Baer
Ranch Hand

Joined: Jun 23, 2010
Posts: 39
I am running Tomcat 6. Several applications run on this server. Currently each application has it's own pool of libraries (JAR) contained in it's lib directory.

I am investigating the performance enhancements provided by moving all of the JARs into the shared Tomcat lib directory.

What performance gains do you get when you use shared libraries across projects?

What are the issues you come across with this approach?

Does it come down to preference?

Please chime in with your opinions and supporting facts. Thank you!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

I wouldn't expect massive performance gains from this. Maybe webapps will start up a little bit faster when you start Tomcat, but probably it will be so little that you won't even notice it.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

It should result in smaller war/ear files for sure.

Also, you can ensure that all applications use the same version of the shared jars.

WP
Kerry Baer
Ranch Hand

Joined: Jun 23, 2010
Posts: 39
Thank you for your response.

What about performance? That's my main concern.

Does it make a difference if different apps are running different versions of a library - memory consumption, objects created?

If all the apps are using the same versions of the libraries, then is there a performance difference between using a shared library and having the libraries included in each project?
Kerry Baer
Ranch Hand

Joined: Jun 23, 2010
Posts: 39
Jesper de Jong wrote:I wouldn't expect massive performance gains from this. Maybe webapps will start up a little bit faster when you start Tomcat, but probably it will be so little that you won't even notice it.


Sorry I overlooked your post. Thank you for your input.
 
jQuery in Action, 2nd edition
 
subject: Shared Java Libraries