0

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

Karsten Koop
  • 2,475
  • 1
  • 18
  • 23
Rodger Nadal
  • 309
  • 2
  • 8
  • 21
  • 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 Dec 14 '17 at 13:03
  • @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 Dec 15 '17 at 07:30
  • 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 Dec 15 '17 at 13:54
  • @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 Dec 20 '17 at 07:14

1 Answers1

0

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

SV Madhava Reddy
  • 1,858
  • 2
  • 15
  • 33
  • I am not able to restart or safe-restart Jenkins as well. What can be the Root Cause. Error :- "Jenkins cannot restart itself as currently configured." – Rodger Nadal Dec 15 '17 at 07:37
  • [https://stackoverflow.com/questions/32790081/jenkins-refuses-to-restart](https://stackoverflow.com/questions/32790081/jenkins-refuses-to-restart) This link will be enough to get your problem solved. – SV Madhava Reddy Dec 18 '17 at 05:30
  • jenkins.exe was already there.I deleted and then again tried. It still showing my an Error. – Rodger Nadal Dec 18 '17 at 08:58
  • When i delete the Existing File,and downloaded the jenkins.exe again. its giving me an Error Message:- Installing a service [.jenkins] $ C:\Users\P10401685\.jenkins\jenkins.exe install 2017-12-18 14:28:56,228 INFO - Installing the service with id 'jenkins' Service with id 'jenkins' already exists – Rodger Nadal Dec 18 '17 at 08:59
  • Do not just delete the files. Instead uninstall the Jenkins using installer. [https://stackoverflow.com/questions/26677637/how-to-uninstall-jenkins-on-windows](https://stackoverflow.com/questions/26677637/how-to-uninstall-jenkins-on-windows) – SV Madhava Reddy Dec 19 '17 at 07:14