2

I keep getting the following error when I reload my app in GWT DevMode after making code changes using Eclipse IDE.

[ERROR] [mymodule] - Failed to create an instance of 'com.myapp.client.widget.MyCustomWidget' via deferred binding 
    [ERROR] [mymodule] - Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

First time I run it, there are no problems, but it is when I do a refresh on the browser (to pickup the code changes) that this error pops up.

Anybody have a solution for this?

Chania
  • 307
  • 3
  • 14
  • What change did you make? Whatever it was, its using too much memory. – Wug Jul 06 '12 at 17:36
  • The code changes are minor bugfixes, which shouldn't affect the size. Whats puzzling is that it loads the first time, but not the second. Makes me wonder if there is a memory leak in GWT DevMode or Eclipse. – Chania Jul 06 '12 at 18:26

1 Answers1

3

I've seen that error before. The default JVM heap memory setting is too low for any non trivial GWT module. You can increase it by modifying the Eclipse launch configuration used to start GWT dev mode. In the launch configuration screen, select the Arguments tab and add this in the "VM arguments" field:

-Xmx512M
David Levesque
  • 22,181
  • 8
  • 67
  • 82
  • 1
    I had already increased Eclipse's settings as follows: --launcher.XXMaxPermSize 2048M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 2048m -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms1g -Xmx2g Same for GWT DevMode settings. I think there is a bug in Eclipse or GWT DevMode's "debug as" option. I noticed that this problem does not occur in "run as". Not having any breakpoints during "debug as" also seems to reduce the problem. – Chania Jul 07 '12 at 09:16