9
votes

This error arise Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Too small initial heap

Please suggest the solution i have tried many solutions but still not working , i hava 2GB ram. The program for hello world was working fine but when i have start new project this error comes. thanks in advance :)

4
could you post the code that is causing the error and show us the settings you are using that might be causing this?Our Man in Bananas
Failed to complete Gradle execution. Cause: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at gradle.org/docs/2.2.1/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Too small initial heapSyed Hamza Hassan
This error arising when i am run hello world program.......Syed Hamza Hassan
Program is simply just to print "Hello world."Syed Hamza Hassan
Dear Our Man In Bananas, Thank you so much for responding. Problem is resolved by setting up VM machine to -Xmx512m. Settings--> compiler(Gradle point)--> Set -Xmx512m.Syed Hamza Hassan

4 Answers

6
votes

I also got this:

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Simply pressed an icon in right-up bar (near SDK Manager) "Sync Project with Gradle Files", that resolved the problem. Also may press Build > Clean project.

EDIT

Also an advice below may help. Or simply add the following line in gradle.properties:

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
13
votes

My same issue solve in Android studio by

File -> Settings -> Compiler (Gradle-based Android Projects)

Type in the Teaxt Area of "VM options" to -Xmx512m -XX:MaxPermSize=512m (copy paste may not work just type it)

Note: May be for Android Studio 1.3 or higher "VM Option" wont be visible under the path mentioned above so add the following line in gradle.properties:

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m

1
votes

I solved this problem configuring the environment variables JAVA_HOME C:\Program Files\Java\jdk1.8.0_45 JDK_HOME C:\Program Files\Java\jdk1.8.0_45 PATH C:\Program Files\Java\jdk1.8.0_45\bin restart your computer and go to Android Studio, that is all.

1
votes
  1. Locate C:\Users\Administrator.gradle
  2. Build file named gradle.properties; add content:org.gradle.jvmargs=-Xmx512m
  3. Remake your Android Studio module

I have tried the other three answers, but only this solution works for me.