For Android Studio 1.3: (method 1)
Step 1. Open the gradle.properties file in the Android Studio project.
Step 2: Add This Line To The End Of The File
org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m
The above methods seem to work, but if it doesn't otherwise (method 2)
Step 1. Launch Android-studio and close any open project ( File> Close Project ).
Step 2: In the welcome window, go to Configure> Settings .
Step 3: Go to Build, Run, Deploy> Compiler
Step 4: Change the heap size of the build process (MB) to 1024 and the Optional build process for VM parameters to -Xmx512m .
Step 5: Close or Restart Android Studio .

Faiz Siddiqui Aug 01 '15 at 10:31 on 2015-08-01 10:31
source share