Memory settings

The following sample sets

Max total memory in this setup is 1280 MB which will work just fine in most cases

-Xmx512m -Xms1024m -XX:MaxPermSize=256m

In very memory constrained environments (server <= 1GB) use the following settings, with a max use of 512 mB

-Xmx384m -Xms384m -XX:PermSize=128m -XX:MaxPermSize=128m

Tomcat6

Windows

The service can be changed by

cd "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
Tomcat6w.exe //ES//tomcat6
-XX:MaxPermSize=256m

Linux

Find catalina.sh in something like: /usr/share/tomcat6/bin

Assign following line to JAVA_OPTS variable and add it into catalina.sh file.

JAVA_OPTS="-Djava.awt.headless=true -server -Xmx512m -Xms1024m -XX:MaxPermSize=256m"

Tomcat7

Windows

As Tomcat 6 except for step 2

cd "C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin
Tomcat7w.exe //ES//tomcat7

See the visual guide here

http://plavc.wordpress.com/2012/02/08/tomcat-service-on-windows/

Linux

sudo nano /etc/tomcat7/tomcat7.conf

Tomcat8

Windows

As Tomcat 7 except for step 2

cd "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin
Tomcat8w.exe //ES//tomcat8

JBoss 7.x

Windows

  1. Edit [JBoss home]\bin\standalone.conf.bat
  2. Ensure the following value is present
 set "JAVA_OPTS= -Xmx512m -Xms1024m -XX:MaxPermSize=256m"