High Memory Usage with Job DSL

112 views
Skip to first unread message

Slide

unread,
Jun 17, 2015, 10:34:07 AM6/17/15
to Jenkins User Mailing List
I just noticed an issue after upgrading the version of Job DSL recently (1.34) that the memory consumption has gone up significantly. I have to restart Tomcat to free up the memory. I am using some custom, monkey patched methods to make the DSL a little friendlier for my HW engineers, so it could be something in what I am doing. I was just wondering if anyone else had seen an issue like this. I would also like to know if anyone can help me figure out how to profile Jenkins (while running under Tomcat) so I can determine where the memory issues are coming from.

Thanks,

Alex

Slide

unread,
Sep 10, 2015, 7:51:42 PM9/10/15
to Jenkins User Mailing List
Anyone have any ideas on this one? I haven't been able to track down what is going on.

Daniel Beck

unread,
Sep 10, 2015, 10:37:31 PM9/10/15
to jenkins...@googlegroups.com

On 11.09.2015, at 01:51, Slide <slide...@gmail.com> wrote:

> I would also like to know if anyone can help me figure out how to profile Jenkins (while running under Tomcat) so I can determine where the memory issues are coming from.

Anything interesting in the heap dump? (Does /computer/(master)/heapDump work when running in Tomcat?)

If you have a bunch of GroovyClassLoaders, could be JENKINS-23762.


Guenther, Marc(AWF)

unread,
Sep 13, 2015, 3:32:59 PM9/13/15
to jenkins...@googlegroups.com
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

Slide

unread,
Sep 13, 2015, 10:46:05 PM9/13/15
to jenkins...@googlegroups.com
So far, upgrading to 1.38 seems a lot better on memory. I will continue to monitor and see how it goes. Thanks very much for the tip!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3535EFE8-98AE-400A-9A60-75C7670B5D27%40ebay.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages