android-studio – How to increase Android Studio IDE memory?

Question:

I've been developing for Android lately, and I've noticed that the Android Studio IDE takes too long to load and start.

So I wonder: how to increase Android Studio IDE memory?

To start the IDE faster and therefore faster development.

Answer:

Proper memory settings for Android Studio IDE

I found the answer in an article , and based on my answer, I decided to share it here on SOes.

Android studio, by default (by default), comes configured with low memory, which is why it is so slow to start, load, develop and deploy.

The secret here is to use a PC with at least 4 GB of RAM and put at least 2 GB for Android Studio.

How to do?

In the installation folder you have a folder called bin (eg C:\Archivos de programa\Android\Android Studio\bin ) and inside it there are 2 files: studio.exe.vmoptions and studio64.exe.vmoptions . If you are using 32-bit PC, please change the studio.exe.vmoptions . If you use 64 bit, switch to the other. correctly configure xmx, xms, permsize, cachesize and other internal.

** Important Warning **

Before editing the files studio.exe.vmoptions and studio64.exe.vmoptions , know that they are the protected files, so it is not enough to edit and save, it will give you error, android studio does not allow to edit and save the file directly in the trash can, then the folder, you're going to do is right click on the file, select open with notepad, edit the file and time to save, it saves the file so -> Name : estudio.exe.vmoptions , Type: Todos los archivos (*) and save it to your escritorio(desktop) and after saving, that is where you copy the new file that appears on your screen and paste it into the bin folder and replace the old file, than the usual procedure – where windows will ask you desea sobrescribir el archivo antiguo con lo nuevo and you click Sí, me desea reemplazar el archivo antiguo con lo nuevo and now all is well, you have updated the replacement for the file!

See the studio.exe.vmoptions file below, it should probably be set to very low values, like this:

#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-server
-Xms256m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

Modify the following passage:

-Xms256m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=512m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=150

Once you've modified the above snippet, save the file to your desktop, like so:

  • Name: studio.exe.vmoptions
  • Type: Todos los archivos (*)

Once you've saved, that's where you copy the new file that appears on your screen and paste it into the bin folder and replace the old one with the file.

See the studio64.exe.vmoptions file below, it should probably be set to very low values, like this:

#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-Xms256m
-Xmx1280m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

Modify the following passage:

 -Xms256m
 -Xmx2048m
 -XX:MaxPermSize=512m
 -XX:ReservedCodeCacheSize=512m
 -XX:+UseConcMarkSweepGC
 -XX:SoftRefLRUPolicyMSPerMB=150

Once you've modified the above snippet, save the file to your desktop, like so:

  • Name: studio64.exe.vmoptions
  • Type: Todos los archivos (*)

Once you've saved, that's where you copy the new file that appears on your screen and paste it into the bin folder and replace the old one with the file.


I have now helped update the files and start the Android Studio IDE, and you will see that Android Studio is starting up much faster!

Scroll to Top