Tomcat – How much memory would Tomcat need

tomcat

I have currently a Linux Server with Java 1.6 and Apache Tomcat/6.0.18 with 512 Mb memory. I am currently hosting one webapp but I plan to move three more applications to this Tomcat instance.

My setenv.sh file is:

JAVA_OPTS="-Xms16m -Xmx256m -XX:MaxPermSize=128m -Djava.awt.headless=true"

When I execute free -m

          total       used       free     shared    buffers     cached
Mem:           512        461         51          0         60         52
-/+ buffers/cache:        348        164
Swap:          127          3        124

Sometimes the used memory goes up until 506 or so.

I guess I have to upgrade the memory. I was thinking about 800 Mb or a 1 Gb. Do you think is a good idea? Will I see the improvent? How should I configure my seteven.sh file after the upgrade?

Best Answer

How much you need completely depends on the architecture of your application(s) and what they are requiring. Adding memory is almost always a good idea. It's hard to say if you'll see improvement if you add 2 more apps to the server that are not there now as you'll not have comparable statistics. If you want to see an improvement add the memory prior to adding the additional applications. The parameters you use for JAVA_OPTS are, again, going to depend on the memory requirements of your applications.

Related Topic