Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Tomcat crashes again and again because of "Out of Memory" error". I wanted to know the exact reason why memory usage is increasing. Below is the cataline.out file errors.

Stack trace of tomcat when services shuted down
23 Nov 2010 11:57:04,171 ERROR (com.bcns.utils.Pagination:161) - Pagination.getPageLinks.Exception/ by zero

Stack trace of tomcat when heap space occured
14 Nov 2010 15:51:57,088 ERROR (apache.tiles.jsp.taglib.RenderTag:228) - IO Error executing tag: JSPException including path '/publics/layouts/header.jsp'.
org.apache.tiles.util.TilesIOException: JSPException including path '/publics/layouts/header.jsp'.      at org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:232)      at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:105) at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96) at org.apache.tiles.renderer.impl.UntypedAttributeRenderer.write(UntypedAttributeRenderer.java:61)      at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669)       at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:337)       at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:234)   at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:211)   at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220)   at org.apache.jsp.publics.layouts.regionalhomepagelayout_jsp._jspx_meth_tiles_005finsertAttribute_005f0(regionalhomepagelayout_jsp.java:540)    at org.apache.jsp.publics.layouts.regionalhomepagelayout_jsp._jspService(regionalhomepagelayout_jsp.java:99)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)       at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)     at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)    at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)    at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669)       at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:689)       at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:643)       at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:626)       at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322)       at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)   at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)      at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)     at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)  at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)       at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)        at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)     at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)      at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)      at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)     at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)  at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)       at org.tuckey.web.filters.urlrewrite.RewrittenUrl.doRewrite(RewrittenUrl.java:176)      at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:758)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)      at java.lang.Thread.run(Thread.java:619)Caused by: javax.servlet.ServletException: java.lang.OutOfMemoryError: Java heap space  at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)      at org.apache.jsp.publics.layouts.header_jsp._jspService(header_jsp.java:1901)  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)     at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)       at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)      at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650)        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644)  at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103) ... 151 moreCaused by: java.lang.OutOfMemoryError: Java heap space

I want to find out the exact reason, wheather its my application bug or OS or I really need more memory as i did not find my significant increase in load average,CPU usage,disk i/o etc.. Only RAM usage becomes high.

Anyone can suggest me any good java monitoring tool to rectify this problem would really be appreciated.

share|improve this question
    
How much heap have you allocated now using Xmx and Xms etc? Defaults are only 64 Mb –  JoseK Nov 25 '10 at 5:47
    
its 256MB and 512MB –  Ramesh Kumar Nov 25 '10 at 16:43

1 Answer 1

up vote 1 down vote accepted

Try enabling java garbage collection logging. This will give you a good idea of how fast the application is using memory, and how well it can be recovered.

You may find some tuning of Java memory parameters will resolve the problem. The Sun documentation includes some good memory tuning documentation. Check the documentation for Tomcat on some typical Java memory settings.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.