I am setting up a development server for a team I am working with. They develop JavaEE applications, which are deployed and run as WAR files. They will inevitably need to run one or two instances of their application constantly on this server.

There are a number of other Java application which also need to run on the server, including Jenkins, Artifactory and some other internal tools deployed as WARs.

Jenkins and Artifactory by default run in their own servlet container, and setting them up in this way is very simple. It occurs to me though that there might be some memory and performance savings made by getting all WARs running within one instance of e.g. Tomcat rather than having Winstone running for Jenkins, Jetty for Artifactory and Tomcat for internal tools.

Are we likely to see significant benefits from using a single servlet container?

1 Answer 1


There is some memory usage advantage to running multiple WARs in the same JVM but on the other hand you'll have more contention and possible larger full GC pauses with one large JVM. Some JVM apps, such as Jenkins, can be very memory intensive which may drive your solution.

As a rough sizing guide, I would do the following:

  • Reserve 500MB to OS
  • Allocate 1-2GB per JVM
  • Use these figures to determine how many JVMs you can run on one box. It's not a good idea to rely on swap for active JVMs.
  • Set inital heap (-Xms) and max heap (-Xmx) to the same value
  • Thanks for the clear tips :) I guess for me these rules can also govern how many Jenkins executors we can support, as each will also be starting Tomcat instances
    – Armand
    Nov 14, 2012 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.