Symptoms
- Apache Tomcat service crashes on every attempt to access the website;
- The following error can be found inÂ
C:Program FilesApache Software FoundationTomcat 7.0logscatalina.xxxx-xx-xx.log
:org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/intranet] threw exception [javax.servlet.ServletException: java.lang.OutOfMemoryError: Java heap space] with root cause
java.lang.OutOfMemoryError: Java heap space
Cause
The specified heap size is insufficient for the application.
Resolution
- Connect to the server via RDP;
- Start Tomcat7w GUI application for monitoring and configuring Tomcat services by clicking atÂ
C:Program FilesApache Software FoundationTomcat 7.0binTomcat7w.exe
- In Java Options field in Java tab add following directives:
-Xmx2048M
-Xmx6144MNote: The mentioned settings allocate 2 GB memory to the start Java heap, 6 GB for the maximum heap size. It should be changed according server’s needs.
- Save the changes and restart Tomcat Apache service at Start > Services:
- Start JAVA application at Home > Domains > example.com > Java Application page
Note: There is a probability that application memory leak can cause running out of memory. If the issue occurs after increasing of heap option consider to review web application code to find what could cause memory leaking.
Â