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

Memory Leak in Stapler web framework?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • Jenkins 2.401.2 - stapler web framework!

      Jenkins is running in 2.401.2 version. Intermittently this Jenkins application was throwing java.lang.OutOfMemoryError. We captured the heap dump from the Jenkins and analyzed it through yCrash's HeapHero tool. Below is the summary of the findings pointed out by the HeapHero tool: 

      1. Tool reported two problem suspects. Problem Suspect 1 was a thread's local variable occupying 56.73% of memory. Problem Suspect 2 was another thread's local variable occupying 27.62% of memory. (Please see the attachment)
      2. Largest Object section of the Heap dump analysis report (please see the attachment). You can notice that thread has a local variable of type 'org.kohuske.stapler.export.Property$BufferedDataWriter'. This variable alone is occupying 3.36GB of data.

      Apparently 'org.kohuske.stapler.export.Property$BufferedDataWriter' internally contains an ArrayList' which has several millions of records in it. It's not clear why several millions of records are accumulated in this 'ArrayList'.

      Quick Googling revealed that 'org.kohuske.stapler.export.Property$BufferedDataWriter' is present in the Stapler library. Apparently Stapler is a web framework used by Jenkins to build user-friendly URLs.

      It isn't clear what's causing the memory leak in this Stapler framework. Appreciate any of your insights.

            Unassigned Unassigned
            ycrash Ram
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: