JFinal + HTTL + jdk1.7 启动服务内存溢出,Java heap space 但jdk1.6正常

Run佳 发布于 2014/02/24 10:13
阅读 1K+
收藏 0

eclispe  开发 JFinal + HTTL  + jdk1.6 发布都正常,
今天服务器升级了jdk1.7,
本地也装了jdk1.7测试 编译后用jetty 启动 都会报错,一下内存就溢出了,求帮助。


<listener> 
 <listener-class>httl.spi.loaders.ServletLoader</listener-class> 
</listener> 
<context-param> 
 <param-name>httl.properties</param-name> 
 <param-value>/WEB-INF/httl.properties</param-value>
</context-param>
web.xml添加也出错

 

2014-02-24 09:56:19
[ERROR]-[Thread: qtp23975493-18]-[httl.spi.loggers.MultiLogger.error()]: Failed to compile class, cause: Java heap space, class: httl.spi.translators.templates.Template__sms_moneyLog_listTj_httl__WEB_INF_httl_UTF_8_1392300841156_stream, code:
================================
package httl.spi.translators.templates;

import com.zejiasoft.model.*;
import com.zejiasoft.base.entity.*;
import com.sms.common.entity.*;
import com.sms.entity.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import httl.*;

public final class Template__sms_moneyLog_listTj_httl__WEB_INF_httl_UTF_8_1392300841156_stream extends httl.spi.translators.templates.OutputStreamTemplate {

private static final byte[] $TXT1 = httl.util.ByteCache.getAndRemove("3347");
private static final byte[] $TXT2 = httl.util.ByteCache.getAndRemove("3348");
private static final String $TXT3 = httl.util.StringCache.getAndRemove("1533");
private static final byte[] $TXT4 = httl.util.ByteCache.getAndRemove("3349");
private static final byte[] $TXT5 = httl.util.ByteCache.getAndRemove("3350");
private static final byte[] $TXT6 = httl.util.ByteCache.getAndRemove("3351");
private static final String $TXT7 = httl.util.StringCache.getAndRemove("1534");
private static final byte[] $TXT8 = httl.util.ByteCache.getAndRemove("3352");
private static final byte[] $TXT9 = httl.util.ByteCache.getAndRemove("3353");
private static final byte[] $TXT10 = httl.util.ByteCache.getAndRemove("3354");
private static final String $TXT11 = httl.util.StringCache.getAndRemove("1535");
private static final byte[] $TXT12 = httl.util.ByteCache.getAndRemove("3355");
private static final byte[] $TXT13 = httl.util.ByteCache.getAndRemove("3356");
private static final String $TXT14 = httl.util.StringCache.getAndRemove("1536");
private static final byte[] $TXT15 = httl.util.ByteCache.getAndRemove("3357");
private static final String $TXT16 = httl.util.StringCache.getAndRemove("1537");
private static final byte[] $TXT17 = httl.util.ByteCache.getAndRemove("3358");
private static final byte[] $TXT18 = httl.util.ByteCache.getAndRemove("3359");
private static final String $TXT19 = httl.util.StringCache.getAndRemove("1538");
private static final byte[] $TXT20 = httl.util.ByteCache.getAndRemove("3360");
private static final byte[] $TXT21 = httl.util.ByteCache.getAndRemove("3361");
private static final byte[] $TXT22 = httl.util.ByteCache.getAndRemove("3362");
private static final String $TXT23 = httl.util.StringCache.getAndRemove("1539");
private static final byte[] $TXT24 = httl.util.ByteCache.getAndRemove("3363");
private static final byte[] $TXT25 = httl.util.ByteCache.getAndRemove("3364");
private static final byte[] $TXT26 = httl.util.ByteCache.getAndRemove("3365");
private static final String $TXT27 = httl.util.StringCache.getAndRemove("1540");
private static final byte[] $TXT28 = httl.util.ByteCache.getAndRemove("3366");
private static final byte[] $TXT29 = httl.util.ByteCache.getAndRemove("3367");
private static final String $TXT30 = httl.util.StringCache.getAndRemove("1541");
private static final byte[] $TXT31 = httl.util.ByteCache.getAndRemove("3368");
private static final byte[] $TXT32 = httl.util.ByteCache.getAndRemove("3369");
private static final String $TXT33 = httl.util.StringCache.getAndRemove("1542");
private static final byte[] $TXT34 = httl.util.ByteCache.getAndRemove("3370");
private static final String $TXT35 = httl.util.StringCache.getAndRemove("1543");
private static final byte[] $TXT36 = httl.util.ByteCache.getAndRemove("3371");
private static final String $TXT37 = httl.util.StringCache.getAndRemove("1544");
private static final byte[] $TXT38 = httl.util.ByteCache.getAndRemove("3372");
private static final String $TXT39 = httl.util.StringCache.getAndRemove("1545");
private static final byte[] $TXT40 = httl.util.ByteCache.getAndRemove("3373");
private static final String $TXT41 = httl.util.StringCache.getAndRemove("1546");
private static final byte[] $TXT42 = httl.util.ByteCache.getAndRemove("3374");
private static final String $TXT43 = httl.util.StringCache.getAndRemove("1547");
private static final byte[] $TXT44 = httl.util.ByteCache.getAndRemove("3375");
private static final String $TXT45 = httl.util.StringCache.getAndRemove("1548");
private static final byte[] $TXT46 = httl.util.ByteCache.getAndRemove("3376");
private static final String $TXT47 = httl.util.StringCache.getAndRemove("1549");
private static final byte[] $TXT48 = httl.util.ByteCache.getAndRemove("3377");
private static final String $TXT49 = httl.util.StringCache.getAndRemove("1550");
private static final byte[] $TXT50 = httl.util.ByteCache.getAndRemove("3378");
private static final byte[] $TXT51 = httl.util.ByteCache.getAndRemove("3379");
private static final java.util.Map $VARS = new httl.util.OrderedMap(new String[] {"BASE_PATH"}, new Class[] {java.lang.Object.class});

private final httl.spi.methods.CodecMethod $httl_spi_methods_CodecMethod;
private final httl.spi.methods.FileMethod $httl_spi_methods_FileMethod;
private final httl.spi.methods.TypeMethod $httl_spi_methods_TypeMethod;
private final httl.spi.methods.MessageMethod $httl_spi_methods_MessageMethod;


public Template__sms_moneyLog_listTj_httl__WEB_INF_httl_UTF_8_1392300841156_stream(httl.Engine engine, httl.spi.Interceptor interceptor, httl.spi.Compiler compiler, httl.spi.Switcher filterSwitcher, httl.spi.Switcher formatterSwitcher, httl.spi.Filter filter, httl.spi.Formatter formatter, httl.spi.Converter mapConverter, httl.spi.Converter outConverter, java.util.Map functions, java.util.Map importMacros, httl.Resource resource, httl.Template parent, httl.Node root) {
 super(engine, interceptor, compiler, filterSwitcher, formatterSwitcher, filter, formatter, mapConverter, outConverter, functions, importMacros, resource, parent, root);
 this.$httl_spi_methods_CodecMethod = (httl.spi.methods.CodecMethod) functions.get(httl.spi.methods.CodecMethod.class);
 this.$httl_spi_methods_FileMethod = (httl.spi.methods.FileMethod) functions.get(httl.spi.methods.FileMethod.class);
 this.$httl_spi_methods_TypeMethod = (httl.spi.methods.TypeMethod) functions.get(httl.spi.methods.TypeMethod.class);
 this.$httl_spi_methods_MessageMethod = (httl.spi.methods.MessageMethod) functions.get(httl.spi.methods.MessageMethod.class);
}

protected void doRenderStream(httl.Context $context, java.io.OutputStream $output) throws java.lang.Exception {
 httl.spi.Filter $filter = getFilter($context, "filter");
 httl.spi.Filter filter = $filter;
 httl.spi.formatters.MultiFormatter $formatter = getFormatter($context, "formatter");
 httl.spi.formatters.MultiFormatter formatter = $formatter;
 java.lang.Object BASE_PATH = (java.lang.Object) $context.get("BASE_PATH");
 $output.write($TXT1);
 filter = switchFilter("<script", $filter);
 $output.write($TXT2);
 if (BASE_PATH instanceof httl.Template) {
 ((httl.Template)BASE_PATH).render($output);
 } else {
 $output.write(doFilter(filter, $TXT3, formatter.toBytes($TXT3, (BASE_PATH instanceof httl.Resource ? httl.util.IOUtils.readToString(((httl.Resource)BASE_PATH).openReader()) : BASE_PATH))));
 }
 $output.write($TXT4);
 filter = switchFilter("</script>", $filter);
 $output.write($TXT5);
 filter = switchFilter("<script", $filter);
 $output.write($TXT6);
 if (BASE_PATH instanceof httl.Template) {
 ((httl.Template)BASE_PATH).render($output);
 } else {
 $output.write(doFilter(filter, $TXT7, formatter.toBytes($TXT7, (BASE_PATH instanceof httl.Resource ? httl.util.IOUtils.readToString(((httl.Resource)BASE_PATH).openReader()) : BASE_PATH))));
 }
 $output.write($TXT8);
 filter = switchFilter("</script>", $filter);
 $output.write($TXT9);
 filter = switchFilter("<script", $filter);
 $output.write($TXT10);
 if (BASE_PATH instanceof httl.Template) {
 ((httl.Template)BASE_PATH).render($output);
 } else {
 $output.write(doFilter(filter, $TXT11, formatter.toBytes($TXT11, (BASE_PATH instanceof httl.Resource ? httl.util.IOUtils.readToString(((httl.Resource)BASE_PATH).openReader()) : BASE_PATH))));
 }
 $output.write($TXT12);
 filter = switchFilter("</script>", $filter);
 $output.write($TXT13);
 if (BASE_PATH instanceof httl.Template) {
 ((httl.Template)BASE_PATH).render($output);
 } else {
 $output.write(doFilter(filter, $TXT14, formatter.toBytes($TXT14, (BASE_PATH instanceof httl.Resource ? httl.util.IOUtils.readToString(((httl.Resource)BASE_PATH).openReader()) : BASE_PATH))));
 }

 

 

 

 

 

===============================
, httl: 1.0.11, jvm: 1.7.0_45, os: Windows XP 5.1 x86
java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
 at com.sun.tools.javac.main.Main.compile(Main.java:475)
 at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
 at httl.spi.compilers.JdkCompiler.doCompile(JdkCompiler.java:185)
 at httl.spi.compilers.JdkCompiler.doCompile(JdkCompiler.java:161)
 at httl.spi.compilers.AbstractCompiler.compile(AbstractCompiler.java:161)
 at httl.spi.compilers.AdaptiveCompiler.compile(AdaptiveCompiler.java:96)
 at httl.spi.translators.templates.CompiledVisitor.compile(CompiledVisitor.java:780)
 at httl.spi.translators.CompiledTranslator.parseClass(CompiledTranslator.java:498)
 at httl.spi.translators.CompiledTranslator.translate(CompiledTranslator.java:412)
 at httl.spi.translators.MixedTranslator.translate(MixedTranslator.java:59)
 at httl.spi.engines.DefaultEngine.parseTemplate(DefaultEngine.java:255)
 at httl.spi.engines.DefaultEngine.getTemplate(DefaultEngine.java:233)
 at httl.Engine.getTemplate(Engine.java:333)
 at httl.spi.engines.DefaultEngine.inited(DefaultEngine.java:399)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at httl.util.BeanFactory.createBean(BeanFactory.java:147)
 at httl.Engine.getEngine(Engine.java:127)
 at httl.web.WebEngine.setServletContext(WebEngine.java:149)
 at httl.web.WebEngine.setRequest(WebEngine.java:92)
 at httl.web.WebEngine.setRequestAndResponse(WebEngine.java:102)
 at httl.web.jfinal.HttlRender.render(HttlRender.java:39)
 at com.jfinal.core.ActionHandler.handle(ActionHandler.java:92)
 at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
 at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:74)
 at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
 at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
 at org.eclipse.jetty.server.Server.handle(Server.java:365)
 at org.eclipse.jetty.server.AbstractHttpConnection.handleReque

加载中
1
Spance
Spance

在eclipse中的jetty启动参数-jvm参数中增加

-Xmx1024m -XX:MaxPermSize=512m

xmx用于增加堆大小,XX:MaxPermSize用于增加持久代大小,酌情增减。

0
代码在天上飘丶我追呀

我想说的是,自从java被oracle收购后。。。那个啥啥哈的。

旧的会被新的代替这是迟早的事,没有什么技术能够一直最好。总会有更好的,

 

0
geek_light
geek_light

jvm参数没有设置好,要根据你的电脑内存情况来设置!~eclipse的话可以修改eclipse.ini文件,具体修改如下:

-vmargs  

-Xms128M  (系统默认设置为你计算机物理内存的64分之1,可以根据实际情况更改)
-Xmx512M  (系统默认为你物理内存的4分之1,根据实际情况修改)
-XX:PermSize=64M (默认为物理内存的64分之1)
-XX:MaxPermSize=128M (默认为物理内存的4分之一)   其中Xms、Xmx分别表示程序运行时存到堆空间的最小、最大内存,PermSize表示非堆空间的初始内存大小,MaxPermSize为非堆空间的最大内存。

0
geek_light
geek_light

根据你的错误 java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space来说:应该是你的栈空间的内存不够了,需要将配置文件eclipse.ini中的-XX:MaxPermSize参数值调大。如果你电脑的内存是1个G,那么调整到256M比较合适。

0
Run佳
Run佳

疯啦,为什么1.6的就可以, jdk 1.7的就要加内存......

0
南湖船老大
南湖船老大

引用来自“代码在天上飘丶我追呀”的答案

我想说的是,自从java被oracle收购后。。。那个啥啥哈的。

旧的会被新的代替这是迟早的事,没有什么技术能够一直最好。总会有更好的,

 

跟oracle收购有啥关系。。。那个啥啥啥
0
南湖船老大
南湖船老大
建议去问HTTL的作者,HTTL由于比较激进的性能优化的bug一直很多,后退或者升级一个版本试试
0
代码在天上飘丶我追呀

python,ruby 方便,快速的技术。

真的,如果ruby不是日本人发明的话,我真的会爱上ruby。

日本有ruby,老外有python,可是我觉得python比ruby要更灵活。

java就像一口井,我的曾经就像井底之蛙,是python点亮了我的生命

可是,当我在python官网寻找第三方支持库的时候,找到一个chinee 支持库

当时,我感觉很兴奋,但是看了说明后,说就像一只鸭子。非常愤慨,气愤的是

老外对国人歧视,感概的是,我们却始终落后。那天我删除了python还有与python相关的很多支持库。下定决心开始学操作系统 api了。

杞人忧天下,希望各位见谅。

 

 

家有仙女
家有仙女
人家问东,你扯西!瞎搞
0
代码在天上飘丶我追呀
有时候,放弃,会得到更多。
0
从今以后
从今以后
期待楼上的操作系统~!
返回顶部
顶部