Error java.lang.OutOfMemoryError: GC overhead limit exceeded

后端 未结 20 2340
攒了一身酷
攒了一身酷 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:39

    Solved:
    Just add
    org.gradle.jvmargs=-Xmx1024m
    in
    gradle.properties
    and if it does not exist, create it.

    0 讨论(0)
  • 2020-11-21 05:41

    I don't know if this is still relevant or not, but just want to share what worked for me.

    Update kotlin version to latest available. https://blog.jetbrains.com/kotlin/category/releases/

    and it's done.

    0 讨论(0)
  • 2020-11-21 05:42

    You need to increase the memory size in Jdeveloper go to setDomainEnv.cmd.

    set WLS_HOME=%WL_HOME%\server    
    set XMS_SUN_64BIT=**256**
    set XMS_SUN_32BIT=**256**
    set XMX_SUN_64BIT=**3072**
    set XMX_SUN_32BIT=**3072**
    set XMS_JROCKIT_64BIT=**256**
    set XMS_JROCKIT_32BIT=**256**
    set XMX_JROCKIT_64BIT=**1024**
    set XMX_JROCKIT_32BIT=**1024**
    
    if "%JAVA_VENDOR%"=="Sun" (
        set WLS_MEM_ARGS_64BIT=**-Xms256m -Xmx512m**
        set WLS_MEM_ARGS_32BIT=**-Xms256m -Xmx512m**
    ) else (
        set WLS_MEM_ARGS_64BIT=**-Xms512m -Xmx512m**
        set WLS_MEM_ARGS_32BIT=**-Xms512m -Xmx512m**
    )
    

    and

    set MEM_PERM_SIZE_64BIT=-XX:PermSize=**256m**
    set MEM_PERM_SIZE_32BIT=-XX:PermSize=**256m**
    
    if "%JAVA_USE_64BIT%"=="true" (
        set MEM_PERM_SIZE=%MEM_PERM_SIZE_64BIT%
    ) else (
        set MEM_PERM_SIZE=%MEM_PERM_SIZE_32BIT%
    )
    
    set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=**1024m**
    set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=**1024m**
    
    0 讨论(0)
  • 2020-11-21 05:44

    The following worked for me. Just add the following snippet:

    android {
            compileSdkVersion 25
            buildToolsVersion '25.0.1'
    
    defaultConfig {
            applicationId "yourpackage"
            minSdkVersion 10
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
    dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    
    0 讨论(0)
  • 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"
        }
    
    0 讨论(0)
  • 2020-11-21 05:46

    Rebooting my MacBook fixed this issue for me.

    0 讨论(0)
提交回复
热议问题