使用-XX时不会生成堆:+ HeapDumpOnOutOfMemoryError

时间:2013-10-16 18:35:33

标签: java tomcat heap heap-dump

我遇到一个问题,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

的输出可以看出,VM选项最为明确

堆目录有足够的空间和写权限(我认为实际上记录了这种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不会触发堆转储。

提前致谢。

威尔

0 个答案:

没有答案