How to increase Android Studio IDE memory?

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

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

To start the IDE faster and therefore the development faster.

 6
Author: Comunidad, 2016-06-04

2 answers

Proper memory configuration for Android Studio IDE

The answer I found in a Article, and it took as a basis my answer and decided to share here on SOes.

Android Studio, by default (default), comes configured with low memory, making it 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 Study.

How to do?

In the installation folder you have a folder called bin (for example, C:\Archivos de programa\Android\Android Studio\bin) and, inside it, there are 2 files: studio.exe.vmoptions and studio64.exe.vmoptions. If you use 32-bit PCs, change the studio.exe.vmoptions. If you use 64 bits, switch to the other. correctly configure xmx, XMS, PermSize, cachesize and other internal.

* * Important Warning * *

Before editing files studio.exe.vmoptions and studio64.exe.vmoptions, they know that files are protected, so, it's not enough to edit and save, you will be given error, Android Studio does not allow editing and saving the file directly in the trash, then the folder, you will do is click on the right-click on the file, select Open with the notes, edit the file and save time, save the file so - > Name: estudio.exe.vmoptions, Type: Todos los archivos (*) and save it to your escritorio(desktop) and after you have saved, that is where you copy the new file that appears in your screen and paste on the bin folder and replace the previous file, which the procedure usual-where the windows will ask you to desea sobrescribir el archivo antiguo con lo nuevo and you click Sí, me desea reemplazar el archivo antiguo con lo nuevo and now everything is fine, you have updated replacement for the file!

See the studio.exe.vmoptions file below, it should probably be with 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 have modified the previous snippet, save the file on the desktop, like this:

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

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

See the studio64.exe.vmoptions file below, it should probably be with 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 there is modified the previous snippet, save the file to the desktop, like this:

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

Once you have saved, that's where you copy the new file that appears on your screen and paste it into the bin folder and replaces 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 is starting Studio much more quick!

 6
Author: , 2017-05-19 07:31:14

I also had the same problem, my Android Studio was slow, it took a long time to do anything...

After much research I found this in SO:

Https://stackoverflow.com/questions/30817871/android-studio-is-slow-how-to-speed-up

Werner Schäffer's answer reads as follows:

I have detected another reason-Thumbs.db, which greatly affects performance: Go to File > Settings > Editor > File Types y in the Ignore files and folders field add the following: Thumbs.db;

To me after doing this I have not had problems again, everything goes like a shot.

 0
Author: Daniel Faro, 2017-05-23 12:39:20