Configure GWT compiler to use less memory?
I am trying to build a large Maven-GWT project on a virtual host, which has a limit amount of RAM and cannot use swap space开发者_JAVA技巧.
The GWT compile stage (where it computes permutations) uses a massive amount of the CPU and memory, and I was wondering if there was any way I could impose a limit on how much of each it uses, even if it takes much longer to compile.
Thanks
If you are using more than one worker thread, decrease it to just one worker thread - that will decrease the memory required. however, the compile will be correspondingly slower. Otherwise, there isn't much you can do to decrease the memory requirements. Setting the xmx to a lower number will work too, but that will cause OOME if it is too low. i think about 256m is the minimum, tho 128m works for most projects of a small to medium size.
add -Dgwt-plugin.localWorkers="1"
and -Dgwt-plugin.extraJvmArgs="-Xmx128m -Xms16m"
to your MAVEN_OPTS
, and tweak those numbers till it works nicely.
精彩评论