I was just updated my last Android Studio and got this error:
failed to create jvm error code -4 JVM Path: C:\\Program Files\\Java\\jdk1.7.0_45\\jre
If you have recently modified Custom VM Options using Help menu, then you should undo your changes or if you have created a new VM options file, remove it. The file can be found on this path:
C:\Users\.AndroidStudio2.1
finally I got answer here. You need to change vmoptions file from android studio.
Go to Program files > Android > Android Studio > Bin > android studio.exe vmoptions file.
Open it with notepad and change the following attributes :
Change -Xmx512m to -Xmx256m
and -XX:MaxPermSize=250m
to -XX:MaxPermSize=128m
or
Change -Xmx750m to -Xmx512m
and -XX:MaxPermSize=350m
to -XX:MaxPermSize=250m