simplicityitself / grails-gwt

New Grails GWT Plugin
Other
23 stars 18 forks source link

Compiler does not complete when JSNI Functions are present #34

Closed confile closed 10 years ago

confile commented 10 years ago

I have a lot of JSNI functions in my GWT application. I use my GWT modules also as separate GWT projects in GGTS. The separate projects can be compiled even in strict mode without any errors.

When I try grails dev war on my grails project then the compile of a GWT module always stops at 33%. After a while GGTS breaks because of the timeout of 180000ms.

How can I fix that? This must be a problem with the plugin because my external gwt project compiles without any problems.

daviddawson commented 10 years ago

I run this against projects that contain JSNI functions without a problem.

Do you have an example app that reproduces your issue?

David Dawson CEO, Principal Consultant Simplicity Itself Limited Tel +44 7866 011 256 Skype: davidadawson david.dawson@simplicityitself.com http://www.simplicityitself.com On 21 Dec 2013 00:55, "Michael G." notifications@github.com wrote:

I have a lot of JSNI functions in my GWT application. I use my GWT modules also as separate GWT projects in GGTS. The separate projects can be compiled even in strict mode without any errors.

When I try grails dev war on my grails project then the compile of a GWT module always stops at 33%. After a while GGTS breaks because of the timeout of 180000ms.

How can I fix that? This must be a problem with the plugin because my external gwt project compiles without any problems.

— Reply to this email directly or view it on GitHubhttps://github.com/simplicityitself/grails-gwt/issues/34 .

confile commented 10 years ago

My current app is still to big to show. I also have 3 other modules that do not have any problems. It turns out that if I delete the JSNI function it is working after clean.

Do you have any idea how to solve this?

confile commented 10 years ago

This is my log output:

================================================================
   Compilation started at Sat Dec 21 02:00:01 CET 2013
================================================================

Base Dir = /Users/mg/Documents/Grails/GGTS3.4.0-KEPLER4.3.1/test
Compiling module test.mobile.Mobile
   Validating units:
      Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2271)
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1857)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1766)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at com.google.gwt.dev.util.Util.writeObjectToStream(Util.java:1193)
    at com.google.gwt.dev.util.DiskCache.writeObject(DiskCache.java:231)
    at com.google.gwt.dev.jjs.UnifiedAst.<init>(UnifiedAst.java:109)
    at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:736)
    at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:278)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
    at com.google.gwt.dev.Compiler.run(Compiler.java:232)
    at com.google.gwt.dev.Compiler.run(Compiler.java:198)
    at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
    at com.google.gwt.dev.Compiler.main(Compiler.java:177)
donbeave commented 10 years ago

Did you tried increase memory?

Add the following to BuildConfig:

gwt.run.args = {
  jvmarg(value: '-Xms1024m')
  jvmarg(value: '-Xmx2048m')
}
daviddawson commented 10 years ago

Hiya @confile , the log does seem to indicate that heap space is the issue.

Could you confirm if that is the case and then I can close this?

confile commented 10 years ago

It us working with the new option: gwt.run.args = { jvmarg(value: '-Xms1024m') jvmarg(value: '-Xmx2048m') }