Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63047

Upgrade Groovy to 2.5.6+ to address OOM / Memory leak

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • core, job-dsl-plugin
    • None
    • Jenkins v2.190.2
      Job DSL v1.77

      TL;DR
      We would like to know if it is possible (or already on your roadmap) to upgrade the version of Groovy in jobdsl-plugin/jenkins-core as we believe it will help with a memory leak we've been seeing.

      Background
      We have a use case in our jenkins deployment where we build pipelines via the jobdsl plugin. We have noticed that when we execute this process multiple times we eventually run out of memory.

      After lots of investigation and heap dump analysis we believe the issue is related to https://issues.jenkins-ci.org/browse/JENKINS-46687 and that the constant use of the GroovyShell.parse / parseClass eventually exhausts the memory. Part of the analysis that leads us to believe this is the attached heap analysis showing that there are instances of the MetaMethodIndex class that are never garbage collected. 

      We did try and set -Dgroovy.use.classvalue=true as per https://issues.jenkins-ci.org/browse/JENKINS-33358 , but that doesnt seem to work for us.

      Looking at this comment in the groovy issues it suggests that upgrading to 2.5.6+ will help improve the evaluation of scripts in Groovy.

      So we are wondering if it is possible to schedule (if not already scheduled) the upgrade of Groovy version? Or maybe even if you could suggest some other potential causes of the problem / solutions to try out?

      Please let us know if you need more detail around this.

       

            bez625 Chris Berry
            bez625 Chris Berry
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: