So I have a problem with memory allocation. Sometimes it works, and sometimes it doesn\'t. I\'ve read this thread and tried the advice there multiple times. Sometimes
Although this question is a bit older I would like to come up with the (possible) rootcause of the problem: the JVM requests a whole block of memory on startup. If it couldn't find it, the "Could not reserve..." error occurs. John Pape wrote an enlighting article in IBM's devblog about this issue: https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/why_wont_my_jvm_start_with_this_heap_size?lang=en
This is solving the problem for me:
org.gradle.jvmargs=-Xmx150m and Gradle has no problems.