• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • windows jenkins server
      windows client
      chrome browser
      autorefresh is enabled

      leaving the dashboard webpage open (with autorefresh) will accumulate lots of memory. I left it open over the weekend and it was using over 700 MB of ram! you can watch the memory consumption increase ~3-10 MB every time it refreshes (manually or automatically). Sometimes it will decrease to the pre-refreshed amount, but it will always increase over time (instantaneous readings may/may not prove true, but long term averages will).

        1. mem_1.457.jpg
          mem_1.457.jpg
          46 kB
        2. mem_1.460.jpg
          mem_1.460.jpg
          34 kB
        3. OoM.jpg
          OoM.jpg
          8 kB

          [JENKINS-10912] Browser/JS memory leak in dashboard

          david abadir created issue -

          I've noticed memory inflation of 1GB overnight with our Jenkins, and the issue seems to be present on the demo jenkins (http://ci.jenkins-ci.org/). I didn't leave it open for that long, but it did increase by 10MB over 10-15 minutes.

          I use Chrome 17 (beta) and tried to see where all that memory was going with dev tools. I tried taking a heap snapshot of my 1GB tab but it crashed it. I tried again after just 10MB of "leak" but couldn't notice much difference in components size. I did notice that memory fluctuates whenever there is network traffic, which occurs when there are ajax requests (ajaxBuildQueue, ajaxExecutors). Those are triggered whether auto refresh is enabled or not (in my case, auto refresh were disabled).

          Nicolas Calderon added a comment - I've noticed memory inflation of 1GB overnight with our Jenkins, and the issue seems to be present on the demo jenkins ( http://ci.jenkins-ci.org/ ). I didn't leave it open for that long, but it did increase by 10MB over 10-15 minutes. I use Chrome 17 (beta) and tried to see where all that memory was going with dev tools. I tried taking a heap snapshot of my 1GB tab but it crashed it. I tried again after just 10MB of "leak" but couldn't notice much difference in components size. I did notice that memory fluctuates whenever there is network traffic, which occurs when there are ajax requests (ajaxBuildQueue, ajaxExecutors). Those are triggered whether auto refresh is enabled or not (in my case, auto refresh were disabled).

          Laura Neff added a comment -

          I've noticed this on Jenkins 1.460, running on Windows, I'm using FireFox. My Jenkins instance seems to be constantly growing in size, I hoped upgrading to 1.460 from approx. 1.420 would help, but doesn't seem to be doing so. This morning I notice that with 1.460, and autorefresh off, just navigating from one Jenkins page to another causes memory usage to increase several K, and space never seems to be recovered. Our Jenkins instance is quiet this morning, no jobs running.

          Laura Neff added a comment - I've noticed this on Jenkins 1.460, running on Windows, I'm using FireFox. My Jenkins instance seems to be constantly growing in size, I hoped upgrading to 1.460 from approx. 1.420 would help, but doesn't seem to be doing so. This morning I notice that with 1.460, and autorefresh off, just navigating from one Jenkins page to another causes memory usage to increase several K, and space never seems to be recovered. Our Jenkins instance is quiet this morning, no jobs running.

          Peter Hayes added a comment -

          I think this should be filed against core, not the dashboard view plugin.

          Peter Hayes added a comment - I think this should be filed against core, not the dashboard view plugin.
          Peter Hayes made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: dashboard-view [ 15679 ]
          Assignee Original: Peter Hayes [ petehayes ]

          Anoop Karollil added a comment - - edited

          We are seeing this problem too (on v1.461). Over time Jenkins uses about 700MB for about 10 jobs. The 'Monitoring' plugin (quite useful by the way) lets you do a garbage collection but that cleared up only 30MB. The histogram shows about 150MB usage over the past week and then a quick ramp yesterday from 150MB to 700MB. There was a jump in number of sessions from 3 to 9 around the time just before the ramping in memory usage happened. I am not sure if its related and the number of sessions dropped to 4 a bit after. CPU usage is also quite high right now, mostly tying down one CPU core.

          Memory histogram shows this:

          Class Size (Kb) % size Instances % instances
          byte[] 132,623 17 179,202 1
          char[] 125,861 16 1,630,859 9
          java.util.HashMap$Entry 65,111 8 2,778,092 16
          java.util.HashMap$Entry[] 51,225 6 700,897 4
          java.lang.String 43,672 5 1,863,370 11
          java.lang.Object[] 30,612 4 453,476 2
          java.util.WeakHashMap$Entry 28,414 3 727,415 4
          java.util.HashMap 27,029 3 691,947 4
          java.util.WeakHashMap$Entry[] 19,986 2 194,526 1
          java.util.Hashtable$Entry[] 17,852 2 311,216 1
          java.util.Hashtable 11,176 1 286,110 1
          java.util.WeakHashMap 9,118 1 194,526 1
          org.apache.commons.jelly.JellyContext 8,378 1 214,498 1 storage/sw/hudson/war/WEB-INF/lib/commons-jelly-1.1-jenkins-20110627.jar
          org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1 8,090 1 115,058 0 storage/sw/hudson/war/WEB-INF/lib/stapler-jelly-1.187.jar
          java.lang.String[] 7,711 1 174,016 1
          java.util.ArrayList 7,655 1 326,640 1

          We recently switched from using Jetty as a container for Jenkins to Winstone. But again, I don't know if that is relevant.

          Anoop Karollil added a comment - - edited We are seeing this problem too (on v1.461). Over time Jenkins uses about 700MB for about 10 jobs. The 'Monitoring' plugin (quite useful by the way) lets you do a garbage collection but that cleared up only 30MB. The histogram shows about 150MB usage over the past week and then a quick ramp yesterday from 150MB to 700MB. There was a jump in number of sessions from 3 to 9 around the time just before the ramping in memory usage happened. I am not sure if its related and the number of sessions dropped to 4 a bit after. CPU usage is also quite high right now, mostly tying down one CPU core. Memory histogram shows this: Class Size (Kb) % size Instances % instances byte[] 132,623 17 179,202 1 char[] 125,861 16 1,630,859 9 java.util.HashMap$Entry 65,111 8 2,778,092 16 java.util.HashMap$Entry[] 51,225 6 700,897 4 java.lang.String 43,672 5 1,863,370 11 java.lang.Object[] 30,612 4 453,476 2 java.util.WeakHashMap$Entry 28,414 3 727,415 4 java.util.HashMap 27,029 3 691,947 4 java.util.WeakHashMap$Entry[] 19,986 2 194,526 1 java.util.Hashtable$Entry[] 17,852 2 311,216 1 java.util.Hashtable 11,176 1 286,110 1 java.util.WeakHashMap 9,118 1 194,526 1 org.apache.commons.jelly.JellyContext 8,378 1 214,498 1 storage/sw/hudson/war/WEB-INF/lib/commons-jelly-1.1-jenkins-20110627.jar org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1 8,090 1 115,058 0 storage/sw/hudson/war/WEB-INF/lib/stapler-jelly-1.187.jar java.lang.String[] 7,711 1 174,016 1 java.util.ArrayList 7,655 1 326,640 1 We recently switched from using Jetty as a container for Jenkins to Winstone. But again, I don't know if that is relevant.

          This seems to happen only when using Chrome, possibly having auto-refresh enabled and leaving the tab open all the time.

          Anoop Karollil added a comment - This seems to happen only when using Chrome, possibly having auto-refresh enabled and leaving the tab open all the time.
          Hans-Juergen Hafner made changes -
          Attachment New: OoM.jpg [ 21805 ]

          We have also Problems with Firefox on Linux and Windows 7 and Internet Explorer on Windows 7.
          After some time IE shows following error:

          In this case, autorefresh was disabled.
          We observed this memory leak using Jenkins 1.457 and 1.459. Currently we are using 1.454. This version seems to have no problem with memory leaks in browser.

          Hans-Juergen Hafner added a comment - We have also Problems with Firefox on Linux and Windows 7 and Internet Explorer on Windows 7. After some time IE shows following error: In this case, autorefresh was disabled. We observed this memory leak using Jenkins 1.457 and 1.459. Currently we are using 1.454. This version seems to have no problem with memory leaks in browser.

          I changed Priority to Major, because our developers are not willing to use a version with this issue.

          Hans-Juergen Hafner added a comment - I changed Priority to Major, because our developers are not willing to use a version with this issue.
          Hans-Juergen Hafner made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

            Unassigned Unassigned
            abadird david abadir
            Votes:
            20 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: