failed to create jvm error code 4 android studio
Go to C:\Program Files\Android\Android Studio\bin\studio.exe.vmoptions
Open it with notepad. some times it will not be editable so give administrative permission and change the following attributes:
-Xmx512m
to -Xmx256m
-XX:MaxPermSize=250m
to -XX:MaxPermSize=128m
Or change:
-Xmx750m
to -Xmx512m
-XX:MaxPermSize=350m
to -XX:MaxPermSize=250m
I have rechecked the java path but its not working in my case. So I deleted the Android Studio settings folder in my user folder.
C:\Users\my_username.AndroidStudio
Then re-open Android Studio then everything work fine for me.
In some case is in C:/Users/my_username/.AndroidStudio3.0/studio64.vmoptions.
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