How to Increase Tomcat Memory
Tomcat service is not starting and if you see the below error in $CATALINA_HOME/logs/
14 mar 2017 14:31:57,258 INFO http-8080-4 com.g2g.connector.qc.QCConnector - Get Release Cycles for the domain ESSAB_BANC_SABADELL and project PF_TEST_RUNS 14 mar 2017 14:32:09,138 ERROR http-8080-4 com.g2g.zk.composer.ConfigComposer - java.lang.OutOfMemoryError: Java heap space
Increasing the Tomcat memory would solve this problem. We discuss below how to increase Tomcat memory in Windows and Linux environments.
- Login as an administrator and open the command prompt.
- Change the directory to tomcat bin.
- Run tomcatXw.exe //ES//CATomcat (or) tomcatXw.exe //ES//TomcatX
where, 'X' is your major Tomcat version, and 'TomcatX' is the name of the service. You can find your service name in services.
- Change the maximum memory pool from 256 MB to 1024 MB as shown in the below image.
5. After Increasing the maximum memory pool , restart the Tomcat service and verify if it is started.
- Go to Apache Tomcat /bin directory.
- By default you will not see 'setenv.sh' (for Linux/Mac) file under the /bin directory. So, create one with below parameters.
- After saving setenv.sh with the required memory values, restart the Tomcat service.
The amended memory values will reflect as shown in the above image, after the restart.