Java – Jenkins (JVM) crashes after few minutes after start

hudsonjavaJenkinsopenvz

  • Host OS: OpenVZ host
  • Guest OS: Debian 6.0 minimal
  • Java: java6 sun
  • Servlet container: Winstone
  • Jenkins for debian: http://pkg.jenkins-ci.org/debian/
  • Jenkins version: 1.449
  • uname -a: Linux hostname 2.6.18-238.9.1.el5.028stab089.1 #1 SMP Thu Apr 14 14:06:01 MSD 2011 i686 GNU/Linux
  • JAVA_ARGS="-Xmx128m -Xms64m -Xrs -XX:HeapDumpPath=/tmp/java-jenkins-dumps -XX:PermSize=128m"
  • free -m:
              total       used       free     shared    buffers     cached
Mem:          2048        532       1515          0          0          0
-/+ buffers/cache:        532       1515
Swap:            0          0          0

After crash:

  • jenkins latests line output: INFO: Jenkins is fully up and running
  • syslog output: Jan 31 17:50:02 cherry jenkins: jenkins: fatal: client (pid 16189) killed by signal 15, exiting
  • user_beancounters has 0 failcnt

The question: what else to debug? Is it worth trying to change servlet container (to tomcat)?

Best Answer

I just fixed a similar issue on one our servers. For some reason the VM we have running Jenkins was using a small memory configuration and the swap partition wasn't currently used. My guess is that at some point Java attempts to allocate a large amount of memory and is killed by the OOM task.

After making sure that the swap partition was activated via a fstab entry the problem went away.

TLDR: you need more virtual or physical memory.