wood burning stoves 2.0*
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 Java 8 in Action this week in the Java 8 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: 13884
    
  10

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: 860

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shared Java Libraries
 
Similar Threads
Shared Java Libraries
SQLException: Driver not found for URL
Proper use of /shared/lib
Problems with moving app from Netbeans to Tomcat
First Struts Application + Unable to load configuration