8
votes

I have started using Android Studio 1.0.1 and there is nothing I can do as I have this error and even the XML can't be rendered.

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.

Somebody else facing the same problem?

6
Hope this may help you: stackoverflow.com/a/60220536/3974530InsaneCat

6 Answers

9
votes

I got the same issue. The fix in my case was to refer to a correct version of JDK. My Android Studio is 64-bit (on Windows you can see it in task manager as studio64.exe) while it was referring to 32-bit JDK. To check it go to File > Other Settings > Default Project Structure > JDK location and check the path. Under windows, if it shows 32-bit location C:\Program Files (x86)\Java\jdk1.7.0_25 instead of 64-bit path C:\Program Files\Java\jdk1.7.0_XX then change it to the correct one. If you don't have a 64-bit JDK then download and install it.

4
votes

I had this problem and the following steps worked well for me :

1.Remove .gradle from the user home directory

2.file -> Invalidate Caches/Restart -> Just Restart

1
votes

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.

Same thing happened with me.It is just because your 32 bit OS doesn't have enough space. Here is the solution,

1.Open File->Settings->Build tools->Compiler

2.there in compiler you just update VM-options to -Xmx512m -XX:MaxPermSize=512m

Note:You need to type the same, including the space in between.

                        OR

1.Just update the line in gradle.properties # org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m

0
votes

You might just be out of virtual memory.

You are focused on RAM usage (or lack of) but your existing JVMs are reserving virtual memory, not RAM. As long as reserved pages of memory are not accessed, there is no RAM usage reported for them.

While Linux usually mask this issue by its over-commitment settings, it is quite possible that the fact you are running in an OS level virtualized environment either reduce/disable over commitment or set a virtual memory resource control capping.

On a regular OS instance (not a container), the easiest way to workaround this is to add some swap which will allow the reserved memory not to waste RAM. On a container, the way to overcome the issue might also require increasing the globally available virtual memory but more generally is simply done by granting more virtual memory to the container.

(https://unix.stackexchange.com/questions/109653/java-could-not-reserve-enough-space-for-object-heap-even-though-there-is-enoug)

0
votes

Hello this is Occured due to VM Selection:-

This is for android studio.Try to follow the following steps:-

1)Go to File and select settings.

2)now select Compiler option in right hand side.

3)Now in VM option put the following value

-Xmx512m -XX:MaxPermSize=512m

Now apply it. This will work for me hopefully work for you.

0
votes

Here is what made it work for me:

File --> Other Settings --> Default Project Structure

Under JDK location, hit the "Use embedded JDK (recommended)" box.