Crash when building GraphHopper via Maven

I tried to build the latest version for the android demo but the command mvn clean install package failed (inside android/app) with:

[INFO] --- android-maven-plugin:4.0.0-rc.2:dex (default-dex) @ graphhopper-android ---
[INFO] Convert classes to Dex : /home/peterk/Documents/quell/graphhopper/android/app/target/classes.dex
[INFO] Java HotSpot(TM) Server VM warning: INFO: os::commit_memory(0x75500000, 119275520, 0) failed; error='Cannot allocate memory' (errno=12)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:03 min
[INFO] Finished at: 2016-01-25T15:46:30+01:00
[INFO] Final Memory: 18M/275M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:4.0.0-rc.2:dex (default-dex) 
...

using 1.7.0_91

My machine is rather low equipped (2-3gb RAM) and I had the IDE still open. Closing the IDE solved the problem. I think the reason behind is that I have too few memory and dexing requires too much and the subprocess then requires the same amount again. See this post here: http://stackoverflow.com/a/2761855/194609

Can we avoid this or reduce memory usage for building the Android demo via maven?

(Maybe I’m missing something here)

I thought with Maven we don’t build the Android demo.
It would need also Maven Android SDK Deployer.

Since there is already implemented a Gradle build for it.

Emux

I just need maven for the releases and have the Android SDK Deployer successfully installed, and all works fine but it looks like the dexing is using lots of memory (and is a subprocess of maven making memory usage worse) … maybe indeed not an issue for the most people as they use Android studio & gradle …