Why Jenkins job is failing with an Out of Memory error?
Troubleshoot
Typically default Jenkins Out-of-Memorysetup Failures
Use this checklist whenhas a Jenkinslow jobsetup thatamount supportsof AIQheap workflowsmemory failsspace (256Mb). This is good enough for medium size scenarios, but bulk scenarios needing to upload a lot of files for the scenario execution might fail with an out-of-OutOfMemoryError: Java heap space error similar to
C:\ProgramData\Jenkins\.jenkins\workspace\Smoke\Smoke.xml:221: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.Arrays.copyOf(Arrays.java:3745)
In this cases you need to increase the default Java heap memory error.
Recommended guidance
Separateto Jenkinscontroller,server.agent,To
builddotool,thatJava,please follow following steps if your Jenkins server is Windows. Similar steps needs to be done in case of Jenkins using linux.-
Log into your Jenkins server via RDP or SSH if it is ubuntu. You will need credentials for this.
Locate the file jenkins.xml file. Location may vary depending of operating system. In case of windows can find it normally at C:\Program Files\Jenkins.
Edit the jenkins.xml file in a test editor to increase the value of the -Xmx java parameter from
-Xmx256m to -Xmx2048m or more
Add a environment variable with JAVA_OPTS name and test-processvalue memory-Xmx2048Mb
Open the failingTaskManager process.
Validation workflow
Identify the exact process reporting out-of-memory.Review heap, container, agent,it andbuild-toolrestartsettings.it.
Runa smaller validation job to isolate scale-related failures.Apply the smallest safe configuration or workload change and document the result.
Last updated: SeptemberJune 20,26, 20262023
If you have any feedback on this topic, please contact us at documentation@appvance.ai