0
votes

I have installed Jenkins first time. Added Build Action as Run HP Automation Test from File System and Post Build Action as Archiving the HP Results. After the job succeeded, it's throwing me an error "java-out-of memory- Heap space"

Note: This error comes after 2-3 build runs.

I made few changes into the Jenkins.xml under C:\Program Files (x86)\Jenkins

From

<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>

To

<arguments>-Xrs -Xmx4096m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>

Restart Jenkins.

When I hit http://localhost:8080, then I need to go through the full Jenkins setup again. Like install plugins, setup user etc. This is a painful task. Please help with the permanent solution for java -heap space error.

OS Version - Windows 2007 Jenkins Version - 2.78

1
You might run in permission problems if you have your jenkins in program files, try moving it to somewhere else, e.g. c:\jenkins otherwise you'd need to run jenkins as admin which is not recommended. - Leonard Brünings
@LeonardBrünings I placed Jenkins in C:\Program Files (x86)\Jenkins.My concern was in order to change the heap size. I am doing the above changes,but after doing so. When I hit refresh, the Jenkins Setup needs to be done again. All my Projects getting deleted. - Rodger Nadal
My guess is that jenkins can't save its configuration files if it is running in C:\Program Files (x86)\Jenkins as everything under C:\Program Files (x86) requires administrative rights by default. That is why I suggested to install jenkins somewhere else, e.g., C:\Jenkins, then jenkins should be able to persist its config and you don't have to repeat it every time. - Leonard Brünings
@LeonardBrüningsIf I am shift the Entire Folder from C:\Program Files (x86)\Jenkins to C:\Jenkins. I don't need to do reinstallation and other stuff again ? Please confirm - Rodger Nadal

1 Answers

0
votes

If you are killing your jenkins using kill -9 <pid>, then the jenkins won't be able to write its data to its config file. So all the set up data will be lost or corrupted. So please don't do that. Here I am attaching 2 links why your server setup is running again. Hope these helps.

Config Errors Because of Killing Jenkins process from CMD

Safe Starting of Jenkins