首页 > 代码库 > Android:java.lang.OutOfMemoryError:GC overhead limit exceeded

Android:java.lang.OutOfMemoryError:GC overhead limit exceeded

Android编译:java.lang.OutOfMemoryError:GC overhead limit exceeded

百度好多什么JVM啊之类的东西,新手简单粗暴的办法:

1、在的Model的build.gradle中配置

android{ 
    ……
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    ……
}

2、在项目的gradle.properties中:

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx5120m

编译运行,完美解决……

Android:java.lang.OutOfMemoryError:GC overhead limit exceeded