How does the Linux kernel device process to kill when their system goes out of memory?
Linux kernel has a feature or application called OOM Killer. It kills the process whenever it is out of memory. OOM decides which process to kill based on a score that it calculates which is called oom_score.
You can find oom_score for each process in /proc/PID/oom_score