I am currently switching from ant to gradle for my multi module web application and at the moment it seems that the current version of Gradle (M9) might be running up agains
None of the above answers worked for me, then I found this-
My System Configuration-
Windows x64 - JDK 32 bit - Cordova 5.4.1 - Ionic 1.7.12
JVM options for running Gradle can be set via environment variables. You can use either GRADLE_OPTS or JAVA_OPTS, or both. JAVA_OPTS is by convention an environment variable shared by many Java applications. A typical use case would be to set the HTTP proxy in JAVA_OPTS and the memory options in GRADLE_OPTS. Those variables can also be set at the beginning of the gradle or gradlew script.
I added the below mentioned two Environment Variables and solved this issue-
Variable Name: GRADLE_OPTS
Variable Value: -Xmx512m
Variable Name: JAVA_OPTS
Variable Value: -Xmx512m
Hope this helps to guys like me.