Most 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.
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).
Edit: From 1.3 onwards, this needs to be set on a per project basis (don’t know why they did this):
Reduce DEX Compiler Heap Size
File->Other Settings->Default Settings->Build, Execution, Deployment->Compiler->Android Compiler
You can again reduce Android 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.
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
- 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. [ictt-tweet-inline hashtags=”#AndroidStudio”]We hope and pray that Google releases a memory efficient version of Android Studio[/ictt-tweet-inline]
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 , Secret Android USSD codes 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.
If you think that you have a link that adds value to this article please contact us at techie[at]techzog[dot]com for evaluation of inclusion into the article.
Comments left solely for spamming links will be deleted. Thank you for understanding.