我遇到一个问题,Java webapp
中运行的Tomcat
会导致很多java.lang.OutOfMemoryError
错误,但是没有生成堆。
我通过CATALINA_OPTS
setenv.sh
中的以下标记
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/
这之前已经奏效,但出于某种原因,现在还没有。
通常我会在Dumping heap to /path/to/heap/dir/
中看到catalina.out
,但不是这次。
从ps
堆目录有足够的空间和写权限(我认为实际上记录了这种IO异常)
由于XSL Transformation
通过taglibs发生了很多JSP
,导致OutOfMemory。
Stack如下所示:
Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.OutOfMemoryError
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:861)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
at org.apache.jsp.WEB_002dINF.jsp.portlets.item_005fsearch.result.view_jsp._jspService(Unknown Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
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.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.ViewRendererServlet.renderView(ViewRendererServlet.java:114)
at org.springframework.web.servlet.ViewRendererServlet.processRequest(ViewRendererServlet.java:86)
at org.springframework.web.servlet.ViewRendererServlet.doGet(ViewRendererServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
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.exoplatform.services.portletcontainer.plugins.pc.portletAPIImp.PortletRequestDispatcherImp.include(PortletRequestDispatcherImp.java:149)
... 88 more
Caused by: java.lang.OutOfMemoryError
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:353)
at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:382)....
我试图理解,在什么情况下OutOfMemoryError不会触发堆转储。
提前致谢。
威尔