I haven’t been able to identify what the problem is - gradle 5.5.1 on jdk 11.0.2 takes 1 min 30 seconds, whereas gradle 6.8.2 on jdk 11.0.2 takes 4 mins.
So I cannot upgrade to gradle 6, it’s just not worth the hit.
From what I’ve observed, it is all due to one module (in a multi module project), all attributed to compiling, and after commenting out all plugins and comparing a clean compile of this one module:
gradle 5.5.1 → 22s
gradle 6.8.2 → 2 mins
I’ve tried removing all plugins so I don’t think its a plugin problem.
I do have 2 annotation processors though: lombok, querydsl - but again, I don’t think its them.
Running gradle with --profile shows all the time is spent in compileJava.
Yet switching to JDK14 the compile completes in 20s…
So, I’m still no closer to explaining why gradle 5.5.1 is okay, but gradle 6.8 isn’t…
If anyone has any suggestions, I’d love to hear them.
Per the issue linked above, you might be impacted by JDK-8209055. This is not caused by annotation processors or plugins, but a memory leak in the compiler itself. The jira indicates the fix was backported, so you might ensure you have the latest JDK11 build.
Note: You are on 11.0.2 which is listed as affected. Try the latest build.