How to speed Android Studio in Linux by changed VM Options

After installing Android Studio 4.1 on Linux, one of the biggest issue was speed of Android Studio at startup. To improve speed vmoptions64 or vmoptions needs to contain the setof lines in blue below. You can change the file using a text editor as follows by opening a terminal window:

$ mousepad ~/.AndroidStudio4.0/config/studio64.vmoptions <enter>

or changing it using Android Studio menu option Help-> Edit Custom VM Options.

Add the following lines to the file, save it and restart Android Studio to see the performance improvement.


Note -Xmx2048m can be changed to even -Xmx4096m. But it all depends on the RAM of the computer.

Restart Android Studio.

Next, in File -> Settings -> Appearance & Behavior -> System Settings -> Memory Settings:
IDE Heap Size Settings = 4096 MB

Gradle daemon max heap size = 1536 MB
Kotlin daemon max heap size = 2048 MB

Restart Android Studio.

Next, select File -> Settings -> Appearance, look for Windows Options -> Animate Windows and uncheck the box. Then look for Window Options -> Show Memory Indicator. Check the box. You will now find the memory used and total memory in the bottom right corner of the Android Studio window.