Android Studio: Increase available Memory

I really like Android Studio. It is tidy, clearly structured and well fitted for developing Android apps. However, it is just released as version 1.x.x and periodically I have problems with the classical JAVA "Out of Memory" exceptions shutting down Android Studio. While I was looking for a solution, I found some approaches to increase the available memory for Android Studio.The following solutions should be known from other JAVA applications like Eclipse.

Two approches to solve the memory issue

You are able to increase the applied memory using a "special" Android Studio file adjusting multiple Java VM Options including the memory variables. You have to search the Android Studio folder and the included file named: Android Studio/bin/studio.exe.vmoptions. Open this file with any text editor. You have to adjust the first two parameters.

-Xms512m

-Xmx2048m

Alternatively you can add a new system environment variable containing the following values:

Name: _JAVA_OPTIONS

Value:-Xms128m to -Xms512m

One more problem - 64bit executable

That approaches are fully correct and should work. However, it does not work for me. Whatever I did the memory was not increasing and after a few minutes Android Studio was shutting down again. Android Studio - Memory usage What was the problem? No magic was in play here. I did not pay attention, that I was simply using the 64bit .exe to start Android Studio. If you do so, you need to adjust the following file instead of the file given above:

Android Studio/bin/studio64.exe.vmoptions.

After adjusting the correct file everything works fine. Next problem please...

{{ message }}

{{ 'Comments are closed.' | trans }}