12

I'm running GWT from within IntelliJ. (Plain GWT, IntelliJ v9). I'm able to run my application via my "GWT development mode" configuration, but when I try to run it through my "local tomcat" configuration, I get a bunch of incomprehensible error messages referring to Oracle and all sorts of weird stuff that I don't use, followed by this error which is sorted to the bottom of all the others:

Error: Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

I'm guessing that this error is the root cause.

According to my understanding, there is a GWT compilation step which runs in a JVM separate to both IntelliJ and tomcat, and so I'm unsure where to set the -Xmx parameter.

My question is: where do I find this -Xmx parameter? (And: am I on the right track, taking this error message at face value, or is it a symptom of deeper problems?)

Tim Cooper
  • 10,023
  • 5
  • 61
  • 77

5 Answers5

13

You can configure the heap in the GWT facet settings:

gwt facet heap

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
2

As CrazyCoder just said you can increase the amount of memory for gwt compiler in the GWT Facet settings. The GWT Compiler running out of memory on bigger apps is very common if you don`t increase the amount of memory. Most projects should be fine with 512m, but on large projects I already needed more memory.

So this is not some out of memory error caused by some bad design on your behalf.

Daniel Kurka
  • 7,973
  • 2
  • 24
  • 43
2

In my application, I set it to 1024 but it gives me out of memory after 7-9 page refresh on dev mode. And after that I tried it to optimize by doing performance hack, I separated my *.gwt.xml for every gwt module for specific browsers by setting:

MySampleModule_FF.gwt.xml

<set-property name="user.agent" value="gecko1_8"/>

And I run my dev mode with this gwt.xml for Firefox. In addition to it also separated internationalization as well.

After that my out of memory issues considerably decreased.

Jama A.
  • 15,680
  • 10
  • 55
  • 88
0

32 bit JDK also sometimes causes Out Of Memory error. Try using 64 bit JDK.

Nitin Jadhav
  • 6,495
  • 1
  • 46
  • 48
0

To those who get the same error under Eclipse, try to restore cache files (if they were removed accidentally in WAR folder ), this way I solve the same problem under my Eclipse project.

timmz
  • 2,194
  • 3
  • 23
  • 29