Error Java Heap size in Android Studio 1.3.1

妖精的绣舞 提交于 2019-11-28 10:18:13

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.

open your projects gradle.properties file and paste it.

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

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:

Command line, java -version:

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

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!