Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window.

Recently a user was executing the application for a while and it died mysteriously. The text:

Killed

was on the terminal. This happened two times. I asked if someone at a different Terminal used the kill command to kill the process? No.

Under what conditions would Linux decide to kill my process? I believe the shell displayed "killed" because the process died after receiving the kill(9) signal. If Linux sent the kill signal should there be a message in a system log somewhere that explains why it was killed?

like image 708
sbq Avatar asked Apr 07 '09 17:04

sbq


People also ask

Why do processes get killed?

The process to be killed is based on a score taking into account runtime (long-running processes are safer), memory usage (greedy processes are less safe), and a few other factors, including a value you can adjust to make a process less likely to be killed.

How does a user kill a process?

Killall command allows you to terminate all the processes owned by a specific user. To do this, use the -u flag.


2 Answers

If the user or sysadmin did not kill the program the kernel may have. The kernel would only kill a process under exceptional circumstances such as extreme resource starvation (think mem+swap exhaustion).

like image 127
dwc Avatar answered Sep 22 '22 06:09

dwc


Try:

dmesg -T| grep -E -i -B100 'killed process' 

Where -B100 signifies the number of lines before the kill happened.

Omit -T on Mac OS.

like image 44
Ravindranath Akila Avatar answered Sep 22 '22 06:09

Ravindranath Akila