Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging.
But even on latest machines it runs slowly, given the gradle builds that are done on it.
To speed up your development you can transfer your Android Studio on Ram Disk.
RAM Disk helps you create a disk directly onto the RAM. The advantage of this is the speed that this disk offers. This disk operates just like any other drive that resides on disk. RAM Disk allows you to save the content of the disk to a image file. Different save options are available to choose from. I like the save option which saves RAM Disk during system shutdown.
The prerequisite of installing Ram Disk is that you should have more than 4GB of RAM. I have tested this setup on a laptop with 8GB RAM. The performance gain i have got, made me write this article. You will notice the difference, once you experience it. So give it a try, if you like, you can move to this setup completely.
I will take you through the process of setting up Android Studio on Ram Disk.
Installing RAM Disk
There are a lot many RAM Disk software’s out there. But i prefer, SoftPerfect RAM Disk, given its performance and its simplicity.
The installation is straightforward. Once installed, you can create a drive say, 4GB.
Install/Move Android Studio to RAM disk
You can move the Android Studio directory directly to RAM Disk, if you have installed Android studio. Or install a fresh copy of Android Studio to RAM Disk.
Set up Android SDK
You can use the Android SDK that comes with Android Studio or have Android Studio point to an existing Android SDK. If you have an existing Android SDK, move that directory to RAM disk. Now make Android Studio point to that directory.
To point to this Android SDK: In Android Studio go to “File” -> “Project Structure” -> “SDK”. Add New SDK and Remove the existing SDK, just to be sure that hard disk SDK is never accessed.
Set up Gradle for Android Studio
The problem i had seen was that even after setting up Gradle environment variables to point to RAM disk, Gradle was being downloaded. This was before i had pointed Android Studio configuration directory.
(Optional) So to have an actual directory dedicated to Gradle i downloaded Gradle and made the “GRADLE_HOME” point to RAM disk.
Also, gradle creates its cache under the home directory of the user. To change that to point to RAM disk you can make “GRADLE_USER_HOME” point to RAM disk.
This is as far as i could configure Gradle. Configuring the Gradle daemon folder to be moved to RAM disk is not known to me and doesnt affect much to the Android studio performance.
Set up Android Studio config folder
This part is critical as this directory is often used by Android Studio. So you must config this folder to be pointed to RAM disk. To do so, you have to edit the “idea.properties” file located under “AndroidStudiobin”
Note that if you don’t config this, this IDE config directory will also be located under the home directory of the user.
Create/Move the Android Studio workspace to RAM disk
You must note that all the build files and source files are stored under Android Studio workspace.
So you must have your Android Studio workspace located under RAM disk.
Just for reference, this is the performance benchmark of SATA-II hard disk.
If you like this article you can like this article using the like buttons bellow and share this with others.
I hope you are able to increase your productivity with this method. Keep Developing !!!