instant run java.lang.OutOfMemoryError: GC overhead limit exceeded

前端 未结 4 1437
刺人心
刺人心 2020-12-14 19:54

I have upgraded to Android Studio 2.1 and I got this error while I am trying to build & run my corporate big project:

Execution failed for task \

4条回答
  •  甜味超标
    2020-12-14 20:33

    Another method to set the heap size for particular jobs is to use environment variables for each job. This ensures that the memory is available when the job that requires a higher memory is not in use.

    GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xms1024M -Xmx8192M -XX:PermSize=512M -XX:MaxPermSize=2048 -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
    
    JAVA_OPTS="-XX:MaxPermSize=2048M"
    

提交回复
热议问题