For large projects with many classes to parse, the default JVM heap size might not suffice. If you encounter java.lang.OutOfMemoryError: Java heap space error consider increasing the maxHeapSize for the test source set:
Add the following argument to thebuild.gradle.kts file:
tasks.withType<Test> {
maxHeapSize = "1g"
}
Add the following argument to the build.gradle file: