Archive

Archive for the ‘J2EE’ Category

Increasing Tomcat’s memory

February 15, 2010 Leave a comment

Hi all,

If memory is not a problem on your server then allocate a large amount of memory, such as 512M or more. Also use the server VM option. EG: (-server -Xms512M -Xmx512M). Usually it is better to set both min and max heap size to the same in server applications.

Accordingly, if you’re using Tomcat (and you’d like to allocate a lot of memory), you can edit the catalina.(bin | sh) file found in the bin directory of your Tomcat installation.

For example, on a Windows machine (where I currently find myself these days), I added the following statement around line 71:

set JAVA_OPTS=%JAVA_OPTS% -server -Xms512M -Xmx512M -XX:MaxPermSize=256m.

Thanks,
Amit