Increase Memory in Linux

You can set the minimum and maximum memory heap size with the JVM -Xms and -Xmx parameters.

For example, to set the minimum heap size to 128 MB and the maximum heap size to 1024 MB.

Let’s first understand what -Xms, -Xmx, -XX:PermSize and -XX:MaxPermSize are:

  • -Xmx<size> Set initial Java heap size.
  • -Xmx<size> – Set maximum Java heap size.
  • -XX:PermSize – Initial java permanent space size.
  • -XX:MaxPermSize – Maximum java permanent space size.

To set the memory you have a file named “setenv.sh” in your /tomcat/bin directory. If the file doesn’t exist then you need to create the file within set the parameters like:

export JAVA_OPTS=”-Xms128m –Xmx256m”

As described above all these settings take place in the setenv.sh. Add the mentioned below:

export JAVA_OPTS=”-Xms128m -Xmx256m -XX:MaxPermSize=512m”

JAVA_OPTS=”-Xms256M –Xmx1024M”

Increase Memory in Windows (Started Manually)

To set the memory you have a file named “setenv.bat” in your /tomcat/bin directory. If the file doesn’t exist then you need to create the file within set the parameters like:

set JAVA_OPTS=”-Xms128m –Xmx256m”

As described above all these settings take place in the setenv.bat. Add the mentioned below:

set JAVA_OPTS=”-Xms128m -Xmx256m -XX:MaxPermSize=512m”

JAVA_OPTS=”-Xms256M –Xmx1024M”

If you face any trouble with getting it done, please contact us via. our 24×7 Live Chat support available at our website.

Tagged: