UiBinder causes build to fail with out of memory

107 views
Skip to first unread message

andrew_d_mackenzie

unread,
Sep 2, 2010, 6:10:23 PM9/2/10
to Google Web Toolkit
I have a reasonable sized GWT project that compiles fine at the
moment.

I started to look at using UiBinder, initially by incorporating the
simplest "HelloWorld" UiBinder code from the tutorial.

However, it causes my build to fail due to out of memory as shown:

GWT Compiling landing module (silent)
[java] [ERROR] Unexpected
[java] java.lang.OutOfMemoryError: Java heap space
[java] at java.lang.Class.getDeclaredMethods0(Native Method)
[java] at java.lang.Class.privateGetDeclaredMethods(Class.java:
2427)
[java] at java.lang.Class.getDeclaredMethod(Class.java:1935)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:499)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispProcessExpression(GenerateJavaAST.java:
527)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.addCallArgs(GenerateJavaAST.java:1990)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processExpression(GenerateJavaAST.java:804)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:500)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispProcessExpression(GenerateJavaAST.java:
527)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processBinaryOperation(GenerateJavaAST.java:
2587)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processExpression(GenerateJavaAST.java:888)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:500)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispProcessExpression(GenerateJavaAST.java:
527)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispProcessStatement(GenerateJavaAST.java:
557)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processStatements(GenerateJavaAST.java:1829)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processStatement(GenerateJavaAST.java:1513)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:500)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.dispProcessStatement(GenerateJavaAST.java:
563)
[java] at com.google.gwt.dev.jjs.impl.GenerateJavaAST
$JavaASTGenerationVisitor.processStatement(GenerateJavaAST.java:1712)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] [ERROR] Out of memory; to increase the amount of
memory, use the -Xmx flag at startup (java -Xmx128M ...)


I would accept the "hit" and add the extra memory flag, but I suspect
something more serious must be wrong. Just including these two lines
of code in my java file (QueryModule.java) cause this failure:

interface MyUiBinder extends UiBinder<DivElement, QueryModule> {}
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

commenting them back out again gets me back to normal.

For reference, here is the QueryModule.ui.xml (copied from tutorial)
file:

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
<div>
Hello, <span ui:field='nameSpan'/>.
</div>
</ui:UiBinder>

I am using GWT2.0.4 with latest version of Eclipse plug-in.

This code is in a GWT module in a sub-package of my project that is
inherited from the "main" package that is being compiled using GWT
compiler with the following Ant task:

<echo message="GWT Compiling landing module (silent)" />
<java classpathref="project.classpath"
classname="com.google.gwt.dev.Compiler" fork="true"
failonerror="true">
<classpath>
<fileset dir="war/WEB-INF/lib">
<include name="**/*.jar" />
</fileset>
</classpath>
<arg value="-war" />
<arg value="war" />
<arg value="-logLevel" />
<arg value="ERROR" />
<arg value="com.bcntouch.ta.landing" />
</java>


Any ideas as to what is causing this problem, and how to avoid it so I
can start using UiBinder would be appreciated.

Jeff Chimene

unread,
Sep 2, 2010, 8:34:57 PM9/2/10
to google-we...@googlegroups.com
It's entirely possible you're at a boundary.
I've seen the same behavior: one more entry in a uibinder file and out
of memory.
You don't say what your current stack size is. I use -Xmx512m

andrew_d_mackenzie

unread,
Sep 3, 2010, 6:43:03 AM9/3/10
to Google Web Toolkit
Thanks Jeff.

I didn't seem to have any specific stack size previously, and as you
said - I must have been close to the limit with the default.

Using -Xmx512m fixed it.

Thanks
Reply all
Reply to author
Forward
0 new messages