The relevant knowledge

Linux Oom-killer is a self-protection mechanism that is triggered when the system cannot allocate memory (trigger condition). The OPERATING system (OS) kills the process that occupies a large amount of memory and benefits most from reclaiming memory to release memory. The system evaluates each process (/proc//oom_score indicates that the process with the largest value is killed.

When oom occurs, you can record it in /var/log/messages as follows:

Thinking of the February

  1. Presumed cause: What are the possible causes for a process to be killed?
    • Kill -9 PID by artificial, unlikely, temporarily not discussed.
    • The operating system is out of memory, triggers oom-killer mechanism, and automatically kills
  2. Verify the guess:
    • View operating system logs/var/log/messagesThe error log

Troubleshooting steps

  1. To check whether the system is down or restarted, search for the keyword KMSG started and type it in xshell

    # cat /var/log/messages
    Copy the code

    The result is as follows:

    2020-11-13 10:16 “KMSG started” is displayed. “KMSG started” is displayed. “KMSG started” is displayed.

    1. Less Searches for abnormal information along the logs

Linux killed some processes. This explains why Java processes were killed.

Going back to the previous question, what causes the reboot?

Since it is a development machine, there are many people using it. I guess the system is not available because of the system memory overflow, so someone restarted the system.

It is also possible that the operating system will automatically restart the system after killing the processes that occupy a large amount of memory, but there is still not enough spare memory.