GWTCompiler Memory
I am using IntelliJ IDEA (my IDE of choice) to work on some GWT stuff. I have been noticing some strange “Out of Memory” exceptions when compiling the GWT code into JavaScript, especially when the application starts to get ‘n bit bigger than your normal “Hello World” program. I am working on an application that, at the moment, contains about 40 very detailed forms and more or less 10 000 LoC. It is still very early in the development and thus, the application will grow some more over the next few months.IntelliJ IDEA 6+ by default includes a plugin named GWT Studio. This plugin allows you to specify only three settings at the moment (under Google Web Toolkit in your IDE Settings). You can specify the path to your GWT installation directory, the output style of the JavaScript, and you can choose to run the GWTCompiler when you build your application. I usually deselect this last option as it saves some time when you are running the application frequently (usually when debugging or experimenting with the style). You can then compile the code to JavaScript from the built-in browser by clicking on the “Compile/Browse” toolbar button.
As you may have noticed, the GWT Studio plugin does not provide settings for the GWTCompiler. This means that you cannot increase the memory for the GWTCompiler itself. You can, however, increase the amount of memory available to the JVM when running the application. To do this, enter the following as a “VM parameter” in your “Run/Debug Configurations”:
-Xmx512M
This will increase the memory to 512Mb when running the application and has worked well enough for me. We have also had some success by specifying the amount of memory available to the GWTCompiler by using Ant build scripts (I’ll leave that for another day).
If anyone else has other suggestions, please post them. I hope that in the near future, the GWT Studio plugin will provide more functionality, but as it is at the moment, it has already made my life a whole lot easier.
PS: If someone in the know is reading this, it would also be nice to be able to specify the output path for compiled JavaScript in the GWT settings.