Required Data: Java Heap Memory Issue On Linux

Article ID:115001122568
2 minute readKnowledge base

Issue

Your Jenkins instance is experiencing high Java heap utilization.

Environment

  • CloudBees Jenkins Enterprise (CJE)

  • CloudBees Jenkins Platform (CJP)

  • Operating System: Linux

Resolution

Download the jenkinsjmap.sh script.

The jenkinsjmap.sh script will need to be made executable by running: chmod +x jenkinsjmap.sh .

Your environment should be configured as documented in Prepare CloudBees CI for Support.

If you are experiencing high Java heap utilization please collect the following data while the issue is occurring:

  1. Generate a Support Bundle, including System properties, controller Log Recorders, Garbage Collection Logs, Slow Request Records, Out Of Memory Errors, controller Heap Histogram, Deadlock Records, Thread dumps of running Pipeline builds, Thread dumps and Items Content.

  2. Run the jenkinsjmap.sh script as the root user in one of the following modes:

    • ./jenkinsjmap.sh PID - for default mode which generates jmap -heap output and jmap -histo output

    • ./jenkinsjmap.sh PID 1 - for heapdump mode which generates jmap -heap output, jmap -histo output, and a heapdump file in binary format

    The data will be generated in the same directory where the script is run.

    + Alternatively, you can request a heap dump using available Java tools if you have issues with the jenkinsjmap.sh script.

    + You can also optionally add the -XX:+HeapDumpOnOutOfMemoryError and -XX:HeapDumpPath=SPECIFY_PATH options to your existing Java arguments that are used when Jenkins starts. With these settings, the JVM will generate a heap dump automatically when an OutOfMemory exception is encountered. However, typically you would notice significant performance problems before all available memory was used up, so capturing a heap dump manually is usually preferable.

  3. Upload the Support Bundle to your support ticket for review. Compress the data generated by the jenkinsjmap.sh script (or <heapdump>.hprof) and upload it via our upload site. Please update your support ticket with the name of the file. Please note that the Support Core plugin v2.35 and higher will include the verbose gc logs. If you are using an older version please include the verbose gc logs (located at -Xlog:gc[...]:file=<some-log-file>:[...] for JDK 11+ or -Xloggc:<some-log-file> for JDK 8: as explained in Prepare CloudBees CI for Support) in the compressed data uploaded to our upload site.