0

我正在从数据库中获取数据(表 911830 中的记录)并将其添加到JR报告中以获取 1000 条记录,其工作正常。当我超过或某个时间给出 Java 堆空间内存错误作为此问题的标题时,它与 Java 堆内存有关,但我将其增加 3Gb 作为(Xms3072m-Xmx3072m)。但仍然得到同样的错误

我的系统配置如下::

  1. 64位没问题
  2. Redhat/ CentOS(最新版本)
  3. 120GB RAID 配置
  4. 2GB RAM 和 2CPU 机器

控制台错误::

Aug 26, 2012 7:11:14 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet `enter code here`jsp threw exception
java.lang.OutOfMemoryError: Java heap space
    at com.opensymphony.module.sitemesh.html.util.CharArray.grow(CharArray.java:267)
    at com.opensymphony.module.sitemesh.html.util.CharArray.append(CharArray.java:117)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser$ReusableToken.writeTo(Parser.java:343)
    at com.opensymphony.module.sitemesh.html.State.handleText(State.java:64)
    at com.opensymphony.module.sitemesh.html.HTMLProcessor$2.text(HTMLProcessor.java:103)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser.parsedText(Parser.java:295)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser.start(Parser.java:109)
    at com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer.start(TagTokenizer.java:33)
    at com.opensymphony.module.sitemesh.html.HTMLProcessor.process(HTMLProcessor.java:90)
    at com.opensymphony.module.sitemesh.parser.HTMLPageParser.parse(HTMLPageParser.java:52)
    at com.opensymphony.sitemesh.compatability.PageParser2ContentProcessor.build(PageParser2ContentProcessor.java:51)
    at com.opensymphony.sitemesh.webapp.ContentBufferingResponse.getContent(ContentBufferingResponse.java:54)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:137)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:143)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    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.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1063)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:801)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
Aug 26, 2012 7:11:14 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
java.lang.OutOfMemoryError: Java heap space
    at com.opensymphony.module.sitemesh.html.util.CharArray.grow(CharArray.java:267)
    at com.opensymphony.module.sitemesh.html.util.CharArray.append(CharArray.java:117)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser$ReusableToken.writeTo(Parser.java:343)
    at com.opensymphony.module.sitemesh.html.State.handleText(State.java:64)
    at com.opensymphony.module.sitemesh.html.HTMLProcessor$2.text(HTMLProcessor.java:103)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser.parsedText(Parser.java:295)
    at com.opensymphony.module.sitemesh.html.tokenizer.Parser.start(Parser.java:109)
    at com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer.start(TagTokenizer.java:33)
    at com.opensymphony.module.sitemesh.html.HTMLProcessor.process(HTMLProcessor.java:90)
    at com.opensymphony.module.sitemesh.parser.HTMLPageParser.parse(HTMLPageParser.java:52)
    at com.opensymphony.sitemesh.compatability.PageParser2ContentProcessor.build(PageParser2ContentProcessor.java:51)
    at com.opensymphony.sitemesh.webapp.ContentBufferingResponse.getContent(ContentBufferingResponse.java:54)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:137)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:143)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    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.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1063)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:801)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
4

2 回答 2

0

您是否尝试过分析您的应用程序?

尝试进行内存转储并进行调查,也许您的内存中有太多相同类型的对象/一些非常大的对象会占用您所有的内存。

您可以考虑使用 JVisualVM 或您组织中可用的任何其他配置文件

于 2012-08-27T05:25:34.227 回答
0

可能比尝试对内存转储进行排序更容易尝试Plumbr。它在发现内存泄漏方面非常好。

于 2012-08-27T13:22:28.310 回答