Solving Android Studio High Memory Usage Problems

android_top_android_studioMost Android Studio users have complaints that the tool is a memory hog and consumes a huge amount of RAM on their computer. Here are some tips on reducing Android Studio memory usage compiled from various sources on the Internet.

Edit: Versions of Android Studio beyond 2.0 have removed some of these settings. They still work well for older versions though.


Reduce Build Process Heap Size in Android Studio

Go to File->Other Settings->Default Settings->Build, Execution, Deployment->Compiler

Change the Build Process Heap Size to a smaller amount like 512 MB from the default size of 700 MB.

Reduce Android Studio Memory Usage

Limit JVM Size Used by Gradle

File->Other Settings->Default Settings->Build, Execution, Deployment->Compiler->Compiler

Limit the size of the Java Virtual Machine used by Gradle. You can do this by entering “-Xmx256m” in the VM Options field. This will slow down the compilation process but save immense memory. The increase in compilation time for a small project was negligible (~10 seconds).

Reduce Android Studio Gradle Memory Usage

Edit: From 1.3 onwards, this needs to be set on a per project basis (don’t know why they did this):

Android Studio Prompt

Reduce DEX Compiler Heap Size

File->Other Settings->Default Settings->Build, Execution, Deployment->Compiler->Android Compiler

You can again reducteAndroid Studio Memory Usage by reducing the DEX Compiler’s Maximum heap size by changing the default value of 700 MB to a lower value like 400 MB. Again this will marginally slow build and deploy time but will reduce Android Studio’s RAM memory consumption.

Reduce Android Studio DEX Compiler Memory Usage

Disable VCS in Android Studio

Disabling VCS in android studio and using an external program to handle VCS helped some users a lot. You can disable VCS by going to File->Settings->Plugins and disable the following:

  • CVS Integration
  • Git Integration
  • GitHub
  • Google Cloud Tools for Android Studio
  • Subversion Integration

Android Studio Memory Usage Issue Solved

Applying these settings helped me reduce Android Studio memory usage from 1.5 GB to 700 MB. My JVM usage also reduced from 500MB to 256MB. We hope and pray that Google releases a memory efficient version of Android StudioTwitter , but until then we hope that the above tips were useful and helped save you loads of frustration in your development process.

Did any of these tips work for you? Let us know in the comments section below.


Also Read: As an Android developer, you might also want to check out our free GCM Notifications Test Tool and bookmark How to Recover Lost Android Keystore Password. You might also want to read up on programming tips on how to share on WhatsApp and Twitter from within your mobile application.

4 thoughts on “Solving Android Studio High Memory Usage Problems

  1. It seems android studio really want to boost hardware purchases, Simply Discontinuing Eclipse and moving forward to AS was an ASS Decision. Now with the Advent of Android Studio 2.0 STABLE Version, everything hinged on the Fast Run or similar crap, the disadvantages are just too heavy, like Gradle 2.8 Compulsory Upgrade, AS 1.5 -> 2.0 Upgrade Fiascos, V7 Library Glitches, are just some of the many problems we are seeing. This made me downgrade to 1.5 !

    Also the newest version are crapping on the Support Compatibility, better look for clandestine tools than to work with AS as a Whole !

  2. newest ver. of android doesn’t have such options in “Build, Execution, Deployment->Compiler” any more…

  3. By doing all these settings My app is not running.The same issue displayed again.

    emulator: WARNING: Requested RAM size of 1536MB is too large for your environment, and is reduced to 864MB.
    Failed to allocate memory: 8
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application’s support team for more information.

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge