Hi,
we had quite some severe memory problems with Job DSL Plugin, but then, we were running it quite often (like, all the time...). In the end, it didn't even survive one working day.
Using the JavaMelody Monitoring Plugin, we saw an ever increasing sawtooth in the "Used non-heap memory" and the "loaded classes count" graphs. We increased max memory and PermGen, but that only delayed the inevitable, it would always hit the max after a while.
Running JProfiler on a test instance, we found two problems:
- JobParent gets injected into the Groovy compiler (only to output some deprecation warning). This by now has been removed in 1.36 (
https://github.com/jenkinsci/job-dsl-plugin/commit/066606f)
- In our dsl scripts, we stored quite a lot of information (stored as local variables of JobParent class). We had to null all these variables, otherwise their content was never gc'ed. Seems there is yet another leak of JobParent somewhere, but we did not find that.
We use monkey patching and Categories in our DSL scripts, but no mixins. Memory is quite stable now, but we still restart Jenkins nightly, mostly out of habit...
Marc