Linux c running error killed

A program running on the server found the kill. /var/log/messages: /var/log/messages:

Aug 11 16:28:11 kernel: Out of memory: Kill process 3080 (forward) score 559 or sacrifice child
Aug 11 16:28:11 kernel: Killed process 3080, UID 0, (forward) total-vm:1429064kB, anon-rss:1130444kB, file-rss:136kB

Linux also has a memory OOM processing, unlike Android to kill the OOM process, Linux is the most memory use process.
when Linux to OOM, means that the memory of the whole system is insufficient, if you don’t kill the process, will lead to the collapse of the system. Each process has an oom_score parameter, such as an output of the oom_score with a PID of 988:

cat /proc/988/oom_score

OOM Killer kills the process with the highest current score when the system reports OOM Killer.

>
One is to increase the system memory,
The second is to optimize the process, so that it occupies less memory.
The oom_score_adj parameter can be used. This parameter will be counted into the oom_score and will prevent the process from being killed (not recommended).


Read More: