Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To build camel maven has to be configured to use more memory:

Unix/Linux/Mac
Code Block
languagetext
export MAVEN_OPTS="-Xms3000m -Xmx3000m -XX:MaxPermSize=512m"

...

Code Block
languagetext
set MAVEN_OPTS=-Xms3000m -Xmx3000m -XX:MaxPermSize=512m

To conserve memory with Java 8 you can set two additional Java options -XX:+UseG1GC to enable G1 garbage collector (default in Java 9) and -XX:+UseStringDeduplication to help decrease Maven memory usage (up to 1.5GB is required currently, but set it a higher):

Unix/Linux/Mac
Code Block
languagetext
export MAVEN_OPTS="-Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication"
Windows
Code Block
languagetext
set MAVEN_OPTS=-Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication

You can try to experiment with parallel builds by adding -T1.5C to MAVEN_OPTS, but be wary as some of the plugins are not thread safe, and the console output will be intertwined. With parallel builds and when using the install goal you might experience race conditions with the local repository, using Takari Concurrent Local Repository will help with that.

A normal build

Code Block
languagetext
mvn clean install

...