How to increase the heap size used by the GWT Maven module when IntelliJ โ€œmakesโ€ it call?

I am updating my project from GWT 2.3.0 to 2.4.0. As a side effect, my GWT compilation fails due to lack of memory. I searched the Internet and found that you can specify additional memory options inside the Maven pom.xml file (by adding a configuration block) as follows:

<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.4.0</version> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> <configuration> <extraJvmArgs>-XX:MaxPermSize=512m -Xmx1024m</extraJvmArgs> </configuration> </plugin> 

This works if I build directly with Maven, but when I build with IntelliJ, it still runs out of memory. When I look at the process details on my OS when IntelliJ is compiled, it still uses -Xmx128m as the flag passed to the JVM.

How to configure the maximum memory that the plugin can use inside IntelliJ?

+6
source share
2 answers

The IntelliJ GWT plugin will build using its own settings and will not use those in the Maven plugin.

You need to go to project settings (see http://www.jetbrains.com/idea/webhelp/gwt-facet.html )

You can increase your "maximum compiler heap" there.

+6
source

In the console in front of the building, you should use the following parameters:

 set MAVEN_OPTS=-Dgwt.extraJvmArgs="-Xms1g -Xmx2g" 

Using -xmx etc. nothing will help, because GWT seems to use its own JVM inside Maven, which does not receive these parameter values. However, -Dgwt.extraJvmArg will be passed to GWT.

0
source

Source: https://habr.com/ru/post/906331/


All Articles