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

Memory leak in org.jenkinsci.plugins.workflow.cps.nodes.Step* objects

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • workflow-cps-plugin
    • None

      I noticed that the heap memory is growing, with a lot of Step's like objects

      org.jenkinsci.plugins.workflow.cps.nodes.Step*

      Even if the jenkins is idle (no activity for a while) those objects remain in memory.

      After a while it uses all the heap and push it up to its max, slowing down then the jenkins primary (UI is getting slower and slower).

      So I have created a heap dump and analyzed it with Eclise Memory Analyzer, which reported those objects as the most used one.

      Is there any configuration or JVM parameter that I would have missed to improve the performances ? (see environment information for details on the current environment)

      According to the info this is the version installed:

      Implementation-Version: 2633.v6baeedc13805

       

      Is there a mechanism / code that is supposed to cleanup those objects once the build completed ? where is that code located ? Why it is still in memory otherwise ?

          [JENKINS-67195] Memory leak in org.jenkinsci.plugins.workflow.cps.nodes.Step* objects

          Thierry added a comment - - edited

          What I see is that in the CpsFlowExecution implementation there is a cleanUpHeap method,

          maybe it misses to set the storage to null around line (1) ? (maybe more action need to be done to make sure all step objects are really released from memory.

          (1) https://github.com/jenkinsci/workflow-cps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java#L1284

           

          Thierry added a comment - - edited What I see is that in the CpsFlowExecution implementation there is a cleanUpHeap method, maybe it misses to set the storage to null around line (1) ? (maybe more action need to be done to make sure all step objects are really released from memory. (1) https://github.com/jenkinsci/workflow-cps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java#L1284  

            Unassigned Unassigned
            tyge68 Thierry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: