• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • support-core-plugin
    • None

      (Thought this was already filed, but cannot find it now.)

      There should be a component which records heap histograms using jmap -histo:live or something equivalent in-process. This can offer at least a guess as to the cause of increasing memory usage, pending an actual heap dump to pinpoint the problem.

          [JENKINS-22791] Record heap histograms

          Jesse Glick created issue -

          evernat added a comment - - edited

          If you have the Monitoring plugin installed in your Jenkins server, then the "/monitoring?part=heaphisto" page will display the same thing to guess the cause of increasing memory usage, and it will offer to take a heap dump for you.

          The "/monitoring?part=heaphisto&format=pdf" will give you the same data as pdf.

          OK, that's not the same as recording heap histograms over time.
          But, you could also use the groovy plugin in a periodic job, to execute the following script and record heap histogram for each execution of your job:
          https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+Scripts#MonitoringScripts-Displayheaphistogram%28objectinstancesperclass%29

          (sorry for groovy)

          evernat added a comment - - edited If you have the Monitoring plugin installed in your Jenkins server, then the "/monitoring?part=heaphisto" page will display the same thing to guess the cause of increasing memory usage, and it will offer to take a heap dump for you. The "/monitoring?part=heaphisto&format=pdf" will give you the same data as pdf. OK, that's not the same as recording heap histograms over time. But, you could also use the groovy plugin in a periodic job, to execute the following script and record heap histogram for each execution of your job: https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+Scripts#MonitoringScripts-Displayheaphistogram%28objectinstancesperclass%29 (sorry for groovy)
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 154906 ] New: JNJira + In-Review [ 178958 ]
          Emilio Escobar made changes -
          Assignee New: Emilio Escobar [ escoem ]
          Emilio Escobar made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Emilio Escobar made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Code changed in jenkins
          User: Emilio Escobar
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java
          http://jenkins-ci.org/commit/support-core-plugin/6e0769a119ea7746efc4da4d33b337f3fdf6eff8
          Log:
          JENKINS-22791 Added heap histogram generation component

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emilio Escobar Path: src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java http://jenkins-ci.org/commit/support-core-plugin/6e0769a119ea7746efc4da4d33b337f3fdf6eff8 Log: JENKINS-22791 Added heap histogram generation component

          Code changed in jenkins
          User: Emilio Escobar
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java
          http://jenkins-ci.org/commit/support-core-plugin/cfd0268183c7cac25acecb84b8a98a219c55561d
          Log:
          JENKINS-22791 ;

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emilio Escobar Path: src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java http://jenkins-ci.org/commit/support-core-plugin/cfd0268183c7cac25acecb84b8a98a219c55561d Log: JENKINS-22791 ;

          Code changed in jenkins
          User: Emilio Escobar
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java
          http://jenkins-ci.org/commit/support-core-plugin/d940fd12dd8bbbe73e2308d0e7c05ad28e0d8f28
          Log:
          JENKINS-22791 The file should be truncated to the first 200 entries, not 500.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emilio Escobar Path: src/main/java/com/cloudbees/jenkins/support/impl/HeapHisto.java http://jenkins-ci.org/commit/support-core-plugin/d940fd12dd8bbbe73e2308d0e7c05ad28e0d8f28 Log: JENKINS-22791 The file should be truncated to the first 200 entries, not 500.

          Code changed in jenkins
          User: Emilio Escobar
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/HeapUsageHistogram.java
          http://jenkins-ci.org/commit/support-core-plugin/42fae57ec6092aa0a822f38feb3b19cbe9d213b9
          Log:
          JENKINS-22791 cache is no longer used

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emilio Escobar Path: src/main/java/com/cloudbees/jenkins/support/impl/HeapUsageHistogram.java http://jenkins-ci.org/commit/support-core-plugin/42fae57ec6092aa0a822f38feb3b19cbe9d213b9 Log: JENKINS-22791 cache is no longer used

            escoem Emilio Escobar
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: