GWT Complier OutOfMemory issue

46 views
Skip to first unread message

lin.liang

unread,
Sep 17, 2010, 7:19:17 AM9/17/10
to Google Web Toolkit, yj...@163.com
The OutOfMemory exception always happen when the gwt project was
complied. The gwt project has 7 modules, and about 5,700 java files.

I have a look at gwt docs. It said that when the project became
bigger, the complier using the memory more too. However, I have set
the memory to 1.7G, it still report the OutOfMemory exception. Is this
the bug of gwt complier? How can I do to solve this issue?

I have no clue about this so far. Look forward your response. Thanks!

Chris Conroy

unread,
Sep 17, 2010, 11:00:06 AM9/17/10
to google-we...@googlegroups.com, yj...@163.com
That should be more than enough memory to run your compile. Do you have a stack trace for the OOME?

FWIW, I have a pending change that should decrease the amount of memory needed to run a compile or DevMode.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


jocke eriksson

unread,
Sep 17, 2010, 1:12:07 PM9/17/10
to google-we...@googlegroups.com
I had this trouble but my project was very small, but my solution was to divide my clientbundles to smaller ones. processing lots of images can consume very much memory.   

2010/9/17 Chris Conroy <con...@google.com>

lin.liang

unread,
Sep 18, 2010, 11:34:43 PM9/18/10
to Google Web Toolkit, con...@google.com
Chris, I didn't see the OOME before using code splitting. In order to
reduce the application's startup time, I adopt code splitting in the
DynaClassGenerator.java (the implementation of GWT generator on data
deferred binding in our project)

1) Before using code splitting, the code is:
if
("com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr".equals(className))
{
....
com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr
instance = new

com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr();
....
}

2) After using code splitting:
if
("com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr".equals(className))
{
....
GWT.runAsync(new RunAsyncCallbackAdapter() {
public void onSuccess() {
com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr
instance = new
com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr();
callback.onSuccess((T)instance);
}
});
....
}

In the former one, the complier work fine. However, in the second one,
the complie process was interrupted by the OOME.
P.S. It about 1,000 instances created by this way (e.g.
com.nantian.iwap3.frameworkdev.client.dataitem.DataItemMgr above).
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsub...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Chris Conroy

unread,
Oct 5, 2010, 11:14:48 AM10/5/10
to lin.liang, Google Web Toolkit
This doesn't address code-splitting per-se, but r8921 and r8850 reduce both DevMode and compiler memory footprint.

Fernando

unread,
Oct 26, 2010, 5:37:09 PM10/26/10
to Google Web Toolkit
Hi:

I have the same problem compiling with GWT 2.0.4. My project has about
3500 classes.

Did you find any solution?

Thanks in advance.

The JVM parameters are:

-Xss32m -Xms32m -Xmx1024m -XX:MaxPermSize=256m

The StackTrace is:

---------------------------------------------------------------------------------------------------------------------------------------
java.lang.OutOfMemoryError
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at com.google.gwt.dev.util.Util.writeBytesToFile(Util.java:1153)
at com.google.gwt.dev.util.Util.writeBytesToFile(Util.java:1138)
at com.google.gwt.dev.javac.StandardGeneratorContext
$PendingResource.commit(StandardGeneratorContext.java:189)
at
com.google.gwt.dev.javac.StandardGeneratorContext.commitResource(StandardGeneratorContext.java:
287)
at
com.google.gwt.user.rebind.rpc.ProxyCreator.create(ProxyCreator.java:
293)
at
com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator.generate(ServiceInterfaceProxyGenerator.java:
57)
at
com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:
418)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
38)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:108)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:54)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
154)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
143)
at com.google.gwt.dev.Precompile
$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.java:
317)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:
95)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.process(AbstractCompiler.java:200)
at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:123)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:234)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.access$200(AbstractCompiler.java:109)
at
com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:
522)
at
com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:
112)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:
47)
at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:
430)
at
com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:
32)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
at com.google.gwt.dev.Compiler.run(Compiler.java:201)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
at
com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at
com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:
81)
at com.google.gwt.dev.Compiler.main(Compiler.java:159)
[ERROR] Out of memory; to increase the amount of memory, use the -
Xmx flag at startup (java -Xmx128M ...)
java.lang.OutOfMemoryError
--------------------------------------------------------------------------------------------------------------------------------------
> > > > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > <google-web-toolkit%2Bunsub...@googlegroups.com<google-web-toolkit%252B unsubs...@googlegroups.com>

Chris Conroy

unread,
Oct 27, 2010, 9:59:25 AM10/27/10
to Google Web Toolkit
For a really large compile, you might want to supply more than 1G of memory. I would try upping your -Xmx.

To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages