0

I was tweaking Android Studio to make it fast. Upon suggestion from this post- Android Studio is slow (how to speed up)? I made the below changes: Under Help> Edit Custom VM Options I have:

-Xms1024m 
-Xmx4096m # <------ increase this to most of your RAM 
-XX:MaxPermSize=1024m 
-XX:ReservedCodeCacheSize=440m 
-XX:+UseCompressedOops 
-XX:-HeapDumpOnOutOfMemoryError 
-Dfile.encoding=UTF-8

Now Android Studio wont start. The error shows up as-

Invalid maximum heap size: -Xmx4096m # <------ increase this to most of your RAM Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

Any suggestion to solve this error or any commands to reset Android Studio or revert this. I tried to edit the Vmoptions but it doesnt had any effect.

Banka
  • 90
  • 1
  • 11

1 Answers1

0

Find your Android Studio bin directory.

In windows the bin directory for Android Studio is usually:

C:\Program Files\Android\Android Studio\bin

Android Studio menu:

Help> Edit Custom VM Options changes a file with a name of the form like: studio.vmoptions

It may be called:

  • studio.vmoptions
  • studio.exe.vmoptions
  • studio64.exe.vmoptions

Note that on Linux machines this file may be named studio64.vmoptions

Fix this/these files and you should be back to a usable Android Studio.

Jon Goodwin
  • 9,053
  • 5
  • 35
  • 54
  • I checked the `idea64.vmoption` and `idea.vmoption` files in my `idea-IU-181.5281.24/bin` folder but the file is set to default. I'm still getting the error. Can you tell me where I am going wrong? – shamiul97 Aug 31 '19 at 12:24