MINOR: Set JVM parameters for the Gradle Test executor processes

We suspect that the test suite hangs we have been seeing are
due to PermGen exhaustion. It is a common reason for
hard JVM lock-ups.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #1926 from ijuma/test-jvm-params

(cherry picked from commit 67e99d0869)
Signed-off-by: Jason Gustafson <jason@confluent.io>
This commit is contained in:
Ismael Juma 2016-09-28 19:15:00 -07:00 committed by Jason Gustafson
parent 8bbb0b216f
commit fe57fe6943
1 changed files with 11 additions and 1 deletions

View File

@ -71,6 +71,10 @@ ext {
gradleVersion = "2.13"
buildVersionFileName = "kafka-version.properties"
maxPermSizeArgs = []
if (!JavaVersion.current().isJava8Compatible())
maxPermSizeArgs = ['-XX:MaxPermSize=512m']
userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
@ -157,11 +161,17 @@ subprojects {
test {
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
minHeapSize = "256m"
maxHeapSize = "2048m"
jvmArgs = maxPermSizeArgs
testLogging {
events = userTestLoggingEvents ?: ["passed", "skipped", "failed"]
showStandardStreams = userShowStandardStreams ?: false
exceptionFormat = 'full'
}
}
jar {
@ -244,7 +254,7 @@ subprojects {
configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = '1g'
jvmArgs = ['-XX:MaxPermSize=512m', '-Xss2m']
jvmArgs = ['-Xss2m'] + maxPermSizeArgs
}
}