Increasing the JVM memory allocation and thread stack size
Use one of the following procedures to increase the JVM memory allocation and thread stack size by using the Tomcat configuration tool, from the command line or by creating a setenv file.
To increase the JVM memory allocation and thread stack size in the Tomcat configuration tool (Windows)
- Navigate to ApacheInstallDirectory/bin and open the TomcatXw.exe file.
(X denotes the Tomcat version number) - Click the Java tab.
- Enter the following recommended values:
- Initial memory pool—1024 MB
- Maximum memory pool—2048 MB
- Thread stack size — Leave this field empty
- Click the General tab.
- Click Start.
- Click OK.
- Restart Tomcat.
To increase the JVM memory allocation and thread stack size for Tomcat from the command line
- Open the catalina.bat file (TomcatInstallDirectory/bin/catalina.bat).
Add the following line:
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx2048mwhere:
- Xms is the initial (start) memory pool
- Xmx is the maximum memory pool
- Xss is the thread stack size
- Restart Tomcat.
- Open the catalina.sh file (TomcatInstallDirectory/bin/catalina.sh).
(If you are unable to find the catalina.sh file, make the following changes in the startup.sh file) Add the following line:
export JAVA_OPTS="-Xms512M -Xmx2048M"
export CATALINA_OPTS="-Xms512M -Xmx2048M"where:
- Xms is the initial (start) memory pool
- Xmx is the maximum memory pool
- Xss is the thread stack size
- Restart Tomcat.
To increase the JVM memory allocation and thread stack size for Tomcat by setenv file
- Navigate to TomcatInstallDirectory/bin
Create a setenv.bat file with the following code:
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx2048mwhere:
- Xms is the initial (start) memory pool
- Xmx is the maximum memory pool
- Xss is the thread stack size
- Run the setenv.bat file and restart Tomcat.
- Navigate to TomcatInstallDirectory/bin
Create a setenv.sh file with the following code:
export JAVA_OPTS="-Xms512M -Xmx2048M"
export CATALINA_OPTS="-Xms512M -Xmx2048M"where:
- Xms is the initial (start) memory pool
- Xmx is the maximum memory pool
- Xss is the thread stack size
- Run the setenv.sh file and restart Tomcat.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*