日期:2014-05-17  浏览次数:20754 次

java.lang.OutOfMemoryError: Java heap space
我的tomcat版本是1.6,jdk版本是1.6
都是安装版本的,运行了两个小型静态化网站,但是经常出现如下错误,平均每一两天重启一起tomcat
才能正常运行,网上的一些例子大部分都是1.5版本的,目录结构不一样,大多数也都是非安装版本的,我具体怎么
解决这个问题
Java code

2012-3-22 1:12:34 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.OutOfMemoryError: Java heap space
    at sun.text.UCompactIntArray.initPlane(Unknown Source)
    at sun.text.UCompactIntArray.setElementAt(Unknown Source)
    at java.text.RBTableBuilder.addOrder(Unknown Source)
    at java.text.RBTableBuilder.addComposedChars(Unknown Source)
    at java.text.RBTableBuilder.build(Unknown Source)
    at java.text.RBCollationTables.<init>(Unknown Source)
    at java.text.RuleBasedCollator.<init>(Unknown Source)
    at java.text.Collator.getInstance(Unknown Source)
    at freemarker.core.Environment.getCollator(Environment.java:736)
    at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:165)
    at freemarker.core.IfBlock.accept(IfBlock.java:80)
    at freemarker.core.Environment.visit(Environment.java:209)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:209)
    at freemarker.core.Environment.process(Environment.java:189)
    at freemarker.template.Template.process(Template.java:237)
    at org.apache.struts2.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:187)
    at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
    at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.ponyjava.common.struts2.interceptor.UrlInterceptor.doIntercept(Unknown Source)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    at org.apache.struts2.components.ActionComponent.executeAction(ActionComponent.java:289)
    at org.apache.struts2.components.ActionComponent.end(ActionComponent.java:172)
    at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackWriter.java:84)
2012-3-22 3:08:37 org.apache.coyote.http11.Http11Protocol pause


我仔细查看了一个log
似乎还有这个报错信息
Assembly code

2012-3-21 10:17:40 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: 

Error reading included file WEB-INF/user_base/ybw_com_www/article_content/1/566_1.txt
The problematic instruction:
----------
==> include arti.relPath(pageNo) [on line 3, column 1 in WEB-INF/ftl_lib/jeecms/nonaction_article.ftl]
 in user-directive cms.ArtiContent [on line 22, column 23 in WEB-INF/user_base/ybw_com_www/template