Java – Android Studio – Java JVM

androidjava

I downloaded the latest version of Android Studio, but I can not use it.
The following message appears:

Failed to create JVM: error code -4

JVM Path: C:\Program Files\Java\jdk1.7.0_45\jre

If you already have a 32-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.

But I've set the JAVA_HOME to

C:\Program Files\Java\jdk1.7.0_45

Added to the end of the Path:

;C:\Program Files\Java\jdk1.7.0_45\bin

javaDebug

java version "1.7.0_45"

Java(TM) SE Runtime Environment (build 1.7.0_45-b18)

Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

What is wrong?

Best Answer

You need to edit your vmoptions file (in my case it was in C:\Program Files\Android\android-studio\bin\studio.exe.vmoptions), open it with a text editor and reduce the values of -Xmx and -XX:PermSize (change -Xmx512m to -Xmx256m and -XX:MaxPermSize=250m to -XX:MaxPermSize=128m). Save it and restart the IDE.