Increasing JVM Size in Apache Tomcat

A Java Virtual Machine on 32-bit operating systems typically has a maximum heap size of 64Mb. The JVM heap space is where all Java objects are stored, as well as memory used by the garbage collector. Sun recommends increasing this value for server applications. We may need to increase the memory limit for better performance. We may increase the size at application level or server level.

Standalone Java Applications

The Java Virtual Machine takes two command line arguments which set the initial and maximum heap sizes:

-Xms and -Xmx. For example if you want to give your Java program needs a 64Mb initial and 256Mb maximum heap size you could launch it as follows:


java -Xms64m -Xmx256m jdbc_prog


Setting the heap size for Tomcat and Java UDRs are variations on the theme and involve figuring out where to pass these arguments to the JVM.

Apache Tomcat

To increase minimum and maximum heap size for Tomcat applications set the CATALINA_OPTS environment variable before starting Tomcat. To set the same heap sizes, on UNIX edit the Tomcat startup.sh script and add a line:


export CATALINA_OPTS=-Xms16m -Xmx256m;

Or, you may create this  environment variable at /etc/profile file in Linux. In such case, you have to reboot the system to make effective this variable.

For More details:

http://informix-zone.com/node/46?bcsi-ac-79063B1DC99A4FDC=1EC1831D00000002ERDlmuR0rs6ge6dByf9wHwjmiMvFAQAAAgAAAAXWBgCEAwAAAAAAAFkFAAA=

2 Responses to Increasing JVM Size in Apache Tomcat

  1. “Aw, this was a serious good submit. In idea I’ve got to take note of in using this method moreover slacking as well as precise effort to create a wonderful article but just what do I’ve faith which i procrastinate a large amount and through no indicates apparently buy a very important factor done.”

  2. click here says:

    Hey! I just wanted to ask if you ever have any issues with
    hackers? My last blog (wordpress) was hacked and I ended up
    losing many months of hard work due to no data backup.
    Do you have any methods to prevent hackers?

Leave a comment