ch3tanz
ch3tanz

Reputation: 3070

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

Upvotes: 6

Views: 14148

Answers (6)

gEt_rIgHt jR
gEt_rIgHt jR

Reputation: 11

In Android Studio go to Help-> Edit Custom VM Options. Hit yes button and then change 1st two values.
More Info - https://developer.android.com/studio/intro/studio-config.html

Upvotes: 1

Pranob
Pranob

Reputation: 661

I had the same problem as you had. But now I have solve it just Updating my JDK version 1.7 to 1.8. Now it’s working fine for me. And configure the Environment Variable with JAVA_HOME and Android Studio ->Project Structure->SDK Location=>JDK Location.

Upvotes: 0

Tiki
Tiki

Reputation: 105

On Windows 7, what worked for me was to point the Android Studio JDK location to where the system JDK (latest) was located.

In the following images, I've marked in red the bits that should be the same.

Android Studio project, File > Project Structure > SDK Location > JDK Location: enter image description here

Command line, java -version: enter image description here

Upvotes: 5

BecomeBetter
BecomeBetter

Reputation: 443

Just open the gradle.properties file in your projects and add:

org.gradle.jvmargs=-Xmx1024m

I met this problem when I upgraded my system to win10

Upvotes: 1

Shvet
Shvet

Reputation: 1201

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.

Upvotes: 6

Rustam
Rustam

Reputation: 6515

open your projects gradle.properties file and paste it.

org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m

Upvotes: 12

Related Questions