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

OutOfMemory due to unbounded storage in OldDataMonitor

    XMLWordPrintable

Details

    Description

      The data map in hudson.diagnosis.OldDataMonitor keeps growing on my machine.

      I have removed an old plugin, which has stored it's settings in all project files.

      Now, on each load/access of a project a new FreeStyleProject object seems to be created and each time the old data is found and the project (as it is a Saveable) is stored as containing old data in the data map of the OldDataMonitor instance.
      One would think that this should not be a problem with only 20 projects but FreeStyleProject does not implement equals and hashCode and therefore every single project object is kept around in this map.
      After a week since the last restart it has accumulated a total of over 200k map entries totaling a whopping 1GB of heap memory.

      I would love to remove this old data but because of bug JENKINS-18809 I can't even do that. I will remove it by hand.

      Attachments

        1. 1.png
          1.png
          217 kB
        2. 2.png
          2.png
          78 kB

        Issue Links

          Activity

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/diagnosis/OldDataMonitor.java
            test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java
            http://jenkins-ci.org/commit/jenkins/681a8ff3070736610f338972ba433379723346fb
            Log:
            [FIXED JENKINS-19544] When OldDataMonitor is reported a Run, just remember the ID rather than holding a strong reference.

            Compare: https://github.com/jenkinsci/jenkins/compare/10eca374e5eb...681a8ff30707

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/diagnosis/OldDataMonitor.java test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java http://jenkins-ci.org/commit/jenkins/681a8ff3070736610f338972ba433379723346fb Log: [FIXED JENKINS-19544] When OldDataMonitor is reported a Run, just remember the ID rather than holding a strong reference. Compare: https://github.com/jenkinsci/jenkins/compare/10eca374e5eb...681a8ff30707
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3248
            JENKINS-19544 Whether or not we manage to save an object with old data, be sure to remove it from the list, and continue with other objects. (Revision 8508fc365ac9faa4fa6ccee116e820c0455f0988)
            [FIXED JENKINS-19544] When OldDataMonitor is reported a Run, just remember the ID rather than holding a strong reference. (Revision 681a8ff3070736610f338972ba433379723346fb)

            Result = SUCCESS
            Jesse Glick : 8508fc365ac9faa4fa6ccee116e820c0455f0988
            Files :

            • test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java
            • core/src/main/java/hudson/diagnosis/OldDataMonitor.java
            • test/src/test/resources/hudson/diagnosis/OldDataMonitorTest/robustness.zip

            Jesse Glick : 681a8ff3070736610f338972ba433379723346fb
            Files :

            • test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java
            • changelog.html
            • core/src/main/java/hudson/diagnosis/OldDataMonitor.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3248 JENKINS-19544 Whether or not we manage to save an object with old data, be sure to remove it from the list, and continue with other objects. (Revision 8508fc365ac9faa4fa6ccee116e820c0455f0988) [FIXED JENKINS-19544] When OldDataMonitor is reported a Run, just remember the ID rather than holding a strong reference. (Revision 681a8ff3070736610f338972ba433379723346fb) Result = SUCCESS Jesse Glick : 8508fc365ac9faa4fa6ccee116e820c0455f0988 Files : test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java core/src/main/java/hudson/diagnosis/OldDataMonitor.java test/src/test/resources/hudson/diagnosis/OldDataMonitorTest/robustness.zip Jesse Glick : 681a8ff3070736610f338972ba433379723346fb Files : test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java changelog.html core/src/main/java/hudson/diagnosis/OldDataMonitor.java

            Will this fix be back-ported to LTS versions?

            esinsag Sagi Sinai-Glazer added a comment - Will this fix be back-ported to LTS versions?
            jglick Jesse Glick added a comment -

            @esinsag I can mark it as a candidate for consideration.

            jglick Jesse Glick added a comment - @esinsag I can mark it as a candidate for consideration.
            rsandell rsandell added a comment -

            could this issue be the cause of PermGen growing indefinitely as well?

            rsandell rsandell added a comment - could this issue be the cause of PermGen growing indefinitely as well?

            People

              jglick Jesse Glick
              rbaradari Ramin Baradari
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: