Out of memory w/o daemon

Hi!

The current JUnit 5 build at Travis runs on Gradle 4.0 and both, JDK 8 and 9. Gradle Daemon is active.

See source: https://github.com/junit-team/junit5
See Travis log: https://travis-ci.org/junit-team/junit5/builds/243728556
See Build Scan(JDK9): https://gradle.com/s/6okoeogpm3526 (memory heap size 1073 MB)

When I switch the daemon off, like suggested here https://docs.gradle.org/4.0/userguide/gradle_daemon.html for CI environments, both Travis jobs fail with an out of memory error: “exit value 137”

The only change to reproduce the issue is to disable the Gradle daemon in .travis.yml via

mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties

See “no daemon” branch at: https://github.com/junit-team/junit5/compare/gradle_no_daemon_at_travis
See Travis log: https://travis-ci.org/junit-team/junit5/builds/243645361
See Build scan (JDK 8): https://gradle.com/s/q5xwmyyxbi4ma (memory heap size 14070 MB)
See Build scan (JDK 9): https://gradle.com/s/ofrhvmuvn4o5a (memory heap size 15829 MB)

When I disable the Gradle daemon on my local machine (Windows 10, JDK 8 or 9) the build works as expected. No out of memory error is produced.

Do you know a way to debug this issue in detail?

Now the spurious oom is back on JDK 9 with activated Gradle daemon:

See https://travis-ci.org/junit-team/junit5/jobs/243955012
See https://scans.gradle.com/s/kto55ghy3hfom (memory heap size 1073 MB)

Related issue https://issues.gradle.org/browse/GRADLE-1946 ?