Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Java Heap size in Android Studio 1.3.1

I recently updated Android Studio from 1.2 to 1.3.1. After updating Gradle Sync failed message is started showing up to increase Java heap size.

Following is the screenshot of error.

TIA

enter image description here

like image 592
ch3tanz Avatar asked Aug 12 '15 11:08

ch3tanz


2 Answers

open your projects gradle.properties file and paste it.

org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
like image 182
Rustam Avatar answered Oct 05 '22 05:10

Rustam


Go to your Android Studio Folder Where it is installed. There is File stduio.exe and studio64.exe with file type of VMOPTIONS, open it in notepad you will see Something like this:

-Xms512m
-Xmx1280m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Didea.paths.selector=AndroidStudio1.3
-Didea.platform.prefix=AndroidStudio

According to error you may need to change 2 values in it.

-Xms512m
-Xmx1280m

check this value and change it.

like image 39
Shvet Avatar answered Oct 05 '22 04:10

Shvet