I've been using Android Studio for 3 months now and one of the apps I started on it has become fairly large. The memory usage indicated at the bottom right of the program says my allocated heap is maxed at 494M.
When I start to change the XML files my memory usage quickly reaches that cap and the IDE crashes with an Out Of Memory error like this.
I've tried to increase the heap size using this but so far there has been no effect.
I've looked at dozens of articles and other questions on how to increase the heap size but none of their answers are working. No matter what I do to the VMOPTIONS or the IDE settings the heap size never increases. I believe I am editting the correct file for the VMOPTIONS because if I purposely give it an invalid command Android Studio complains about it and doesn't start.
I'm using windows 7 - 64 bit and have 16GB RAM. Has anyone else had this problem with Android Studio? And were you able to fix it?
Or, you can go to your
android-studio\bin
folder and change these -Xmx and -Xms values instudio.exe.vmoptions
orstudio64.exe.vmoptions
files (depending on which version you are running).IF by changing or creating the
.studio.exe.vmoptions
doesn't work, then try changing thegradle.properties
file and change the heap size as per your requirement.It really worked for me on my Windows 7 with 4Gb RAM and Android Studio 2.2 install on it.
Working properly with no error and displaying 'Gradle Sync complete'