Error java.lang.OutOfMemoryError: GC overhead limit exceeded

后端 未结 20 2364
攒了一身酷
攒了一身酷 2020-11-21 05:23

I get this error message as I execute my JUnit tests:

java.lang.OutOfMemoryError: GC overhead limit exceeded

I know what an OutOfMemo

20条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 05:46

    increase javaMaxHeapsize in your build.gradle(Module:app) file

    dexOptions {
        javaMaxHeapSize "1g"
    }
    

    to (Add this line in gradle)

     dexOptions {
            javaMaxHeapSize "4g"
        }
    

提交回复
热议问题