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

OutOfMemory due to unbounded storage in OldDataMonitor

      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.

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

          [JENKINS-19544] OutOfMemory due to unbounded storage in OldDataMonitor

          Ramin Baradari created issue -
          Ramin Baradari made changes -
          Link New: This issue is related to JENKINS-18809 [ JENKINS-18809 ]
          Ramin Baradari made changes -
          Labels New: memory-leak

          Tim Drury added a comment -

          After updating to 1.542 (then downgrading to 1.532.1) on Windows Server 2008 R2, I had to disable the disk-usage plugin because it appeared hung. After disabling it, I now get daily OOM errors. Analyzing a couple heap dumps shows the 'data' hashmap in hudson.diagnosis.OldDataMonitor holding 90% of my 3.5GB heap.

          Tim Drury added a comment - After updating to 1.542 (then downgrading to 1.532.1) on Windows Server 2008 R2, I had to disable the disk-usage plugin because it appeared hung. After disabling it, I now get daily OOM errors. Analyzing a couple heap dumps shows the 'data' hashmap in hudson.diagnosis.OldDataMonitor holding 90% of my 3.5GB heap.

          Tim Drury added a comment -

          Here is more information on my particular issue: https://groups.google.com/d/msg/jenkinsci-users/ZK1J6R2ej4I/-vnEFc-yr0gJ

          Tim Drury added a comment - Here is more information on my particular issue: https://groups.google.com/d/msg/jenkinsci-users/ZK1J6R2ej4I/-vnEFc-yr0gJ
          Jesse Glick made changes -
          Labels Original: memory-leak New: memory-leak performance

          I am running into the same problem with Jenkins 1.552 on Debian 5.0.

          The error shows up when the FingerprintCleanupThread starts running (usually during the night). The process fills the heap memory with one very large object: "hudson.diagnosis.OldDataMonitor". The object is never deleted out of the heap memory. I increased memory for Jenkins and triggered the process manually (FingerprintCleanupThread.invoke() in the script console). Each run stacks on the memory until no more memory is available causing the UI to crash and the jenkins.log filling up with errors of "Process leaked file discriptor".

          The "Manage Old Data" screen (reachable via Manage Jenkins) shows a lot of “failed to locate class: com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.disk_usage.BuildDiskUsageAction" errors. I was able to discard them using the button at the bottom of the screen. After I discarded the errors i started the FingerprintCleanupThread again and it used far less memory. There are new errors showing up in the "Manage Old Data" screen during the day, so I have to check them every day.

          Is there any possibility for a complete removal of the DiskUsagePlugin?

          Michael Niestegge added a comment - I am running into the same problem with Jenkins 1.552 on Debian 5.0. The error shows up when the FingerprintCleanupThread starts running (usually during the night). The process fills the heap memory with one very large object: "hudson.diagnosis.OldDataMonitor". The object is never deleted out of the heap memory. I increased memory for Jenkins and triggered the process manually (FingerprintCleanupThread.invoke() in the script console). Each run stacks on the memory until no more memory is available causing the UI to crash and the jenkins.log filling up with errors of "Process leaked file discriptor". The "Manage Old Data" screen (reachable via Manage Jenkins) shows a lot of “failed to locate class: com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.disk_usage.BuildDiskUsageAction" errors. I was able to discard them using the button at the bottom of the screen. After I discarded the errors i started the FingerprintCleanupThread again and it used far less memory. There are new errors showing up in the "Manage Old Data" screen during the day, so I have to check them every day. Is there any possibility for a complete removal of the DiskUsagePlugin?

          Attached two screenshots:

          1) is showing the increasing memory usage for each FingerprintCleanupThread run.
          2) is showing the heap-dump after the last run.

          Michael Niestegge added a comment - Attached two screenshots: 1) is showing the increasing memory usage for each FingerprintCleanupThread run. 2) is showing the heap-dump after the last run.
          Michael Niestegge made changes -
          Attachment New: 1.png [ 25504 ]
          Attachment New: 2.png [ 25505 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-20950 [ JENKINS-20950 ]

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

              Created:
              Updated:
              Resolved: