[system.out] java.lang.OutOfMemoryError: PermGen space

When I run test case by Gradle, I got the error. Please help me out

14:38:45.025 [QUIET] [system.out] java.lang.OutOfMemoryError: PermGen space 14:38:46.482 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:48.634 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:50.831 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:52.936 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:55.153 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:57.359 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:38:59.696 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:02.396 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:04.370 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:06.369 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:08.701 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:10.662 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:12.785 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:15.122 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:17.077 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:18.966 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:21.218 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:23.588 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:25.698 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:27.797 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:29.668 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:31.584 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:33.568 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:35.549 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:37.595 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:39.521 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:41.615 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:43.636 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:45.598 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:47.622 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:49.645 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:51.674 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:53.669 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:55.786 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:57.828 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:39:59.771 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:01.756 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:03.754 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:05.744 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:08.079 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:10.357 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:13.199 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:15.125 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index 14:40:17.271 [QUIET] [system.out] java.lang.VerifyError: (class: org/gradle/api/GradleException, method: signature: (Ljava/lang/String;Ljava/lang/Throwable;)V) Illegal constant pool index

My setting is

export JAVA_OPTS="-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M" export GRADLE_OPTS="-Dorg.gradle.daemon=true"

Can be simplified a little to:

test {
    jvmArgs "-XX:MaxPermSize=256m"
}
1 Like

Thanks. It works fine now

thanks man u saved me …

That helped

You probably need something like this to set the MaxPermSize on the forked test process:

test {
 jvmArgs += [ "-XX:MaxPermSize=256m" ]
}