Getting Gradle error “Could not reserve enough space for object heap” constantly in Intellij IDEA

I got the same error in Visual Studio 2015 with cordova 5.1.1 under Windows 10.

To solve the issue, set this environment variable:

_JAVA_OPTIONS=-Xmx512M
  1. Right click on start-button and open “System”
  2. Search for “Advanced system settings” and open it
  3. Click the button “Environment Variables …”
  4. In System Variables, click “New…”
  5. New Variable Name: _JAVA_OPTIONS
  6. New Variable Value: -Xmx512M
  7. Click OK
  8. Restart Visual Studio, so the variable is picked up

This Article point me in the right direction. I did change the instructions a littel bit, so they fits to Windows 10.

Hope it helps someone!

Leave a Comment