Groovy memory leaks


(Markus Oley) #1

Hi anyone,

I wanted to migrate to gradle 3.2.1, but I think I ran into a classloader leak, getting same Thread like shown in https://issues.apache.org/jira/browse/GROOVY-7683.

I am using jdk8 and I create a new URLClassloader with project urls to load some things from the project and close it cleanly afterwards. With gradle 2.13 using groovy 2.4.4 this worked as a charme. With gradle 3.2.1 and groovy 2.4.7 I get this issue.

Can you please give me a hint how to workaround this or when you update to groovy-2.4.8, where it seems to be fixed?
Any help welcome
Cheers
Markus


(Benjamin Muschko) #2

Gradle currently bundles the latest version of Groovy: 2.4.7. Groovy 2.4.8 hasn’t been released yet but we’ll make sure to integrate with the next major version of Gradle: https://github.com/gradle/gradle/issues/1054.


(Markus Oley) #3

by the way: A workaround for me was to add a system property in the gradlew file (both windows and linux):
DEFAULT_JVM_OPTS="-Dgroovy.use.classvalue=true"

Don’t know if it solves the problem in all cases, but for my special case it seems to work