Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins active (exited)

For some reason Jenkins stops working all the time and I have to restart jenkins service to make it work again. Every time this happens service is "active (exited)" but there is nothing in the logs. I use Ubuntu 16.04.

root@laran:~# service jenkins status
    ● jenkins.service - LSB: Start Jenkins at boot time
       Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
       Active: active (exited) since Sun 2017-03-05 06:09:46 EST; 6min ago
         Docs: man:systemd-sysv-generator(8)
      Process: 25459 ExecStop=/etc/init.d/jenkins stop (code=exited, status=0/SUCCESS)
      Process: 25477 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)
like image 607
Filip Sobol Avatar asked Mar 05 '17 11:03

Filip Sobol


People also ask

Why my Jenkins is not starting in Linux?

If the tomcat was running on port 8080, then Jenkins would not be able to start because it defaults to port 8080. There is a configuration setting in the /etc/default/jenkins file that will change the port number.


1 Answers

Possibly the Linux kernel's oom-killer ("out-of memory killer") killed your JVM. It sends a SIGKILL signal to selected processes if the physical memory is no longer sufficient to accomodate all processes. Check that output of journalctl for lines containing the string oom-killer to confirm.

It is normal that the oom-killer strikes only after a certain period. Normally, Linux does not impose restrictions on the amount of virtual memory that a process requests (so your JVM can easily allocate 2 GiB of RAM on a 512 MiB system). However, if the process starts actually using the allocated memory (in your case: amount of used heap grows), then the kernel may find that the amount of physical memory is no longer sufficient. This is the point where the oom-killer will select a promising candiate process to be killed. Jenkins, as a non-system process that consumes a lot of memory, has very good chances to be the one that will be killed.

You can solve the situation by

  • adding more physical memory to your system
  • reducing JVM memory settings (e.g., smaller heap)
like image 65
Alex O Avatar answered Oct 01 '22 03:10

Alex O