• 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

          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)

          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

          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/256310135ad3ecd237f0ce2ccf82a84e84f4473a
          Log:
          JENKINS-22791 removed unused parameter and redundant line

          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/256310135ad3ecd237f0ce2ccf82a84e84f4473a Log: JENKINS-22791 removed unused parameter and redundant line

          Code changed in jenkins
          User: Steven Christou
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/HeapUsageHistogram.java
          http://jenkins-ci.org/commit/support-core-plugin/ea8b5b929a0cd7196f70018e8ae3e1e5845809d1
          Log:
          Merge pull request #119 from escoem/JENKINS-22791

          JENKINS-22791 Record heap histograms

          Compare: https://github.com/jenkinsci/support-core-plugin/compare/6cb4198b778a...ea8b5b929a0c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Steven Christou Path: src/main/java/com/cloudbees/jenkins/support/impl/HeapUsageHistogram.java http://jenkins-ci.org/commit/support-core-plugin/ea8b5b929a0cd7196f70018e8ae3e1e5845809d1 Log: Merge pull request #119 from escoem/ JENKINS-22791 JENKINS-22791 Record heap histograms Compare: https://github.com/jenkinsci/support-core-plugin/compare/6cb4198b778a...ea8b5b929a0c

          PR has been merged and the feature will be probably included with support-core-plugin:2.42

          Emilio Escobar added a comment - PR has been merged and the feature will be probably included with support-core-plugin:2.42

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

              Created:
              Updated:
              Resolved: