Sony will bring Linux a solution to insufficient device memory
Sony engineer Peter Enderborg recently proposed a new Watchdog software in an email from LKML. The full name of Watchdog is Watchdog Timer, also known as COP (Computer Operating Properly) timer, which is generally used in computers to detect unrecoverable errors and reset the system in this case. Similarly, in the case of out-of-memory (OOM), there are some watchdogs that can perform corresponding functions.
However, according to Peter Enderborg, the new watchdog will not perform a hard restart but will take “pre defined actions” to try to kill any unimportant processes that cause this low memory situation. This method uses “oom_score_adj” functions to perform corresponding operations, and the watchdog will kill these processes with the highest “oom_score_adj”.
“oom_score” is the score assigned by the Linux kernel to each running process. The larger the number, the higher the memory usage of the process. At the same time, “oom_score_adj” can help the system determine which processes should be killed, so as to correctly handle these processes in the event of OOM.
“oom_score_adj” varies from -1000 to 1000. The larger the number, it means that the process is not so important to the system at the time and can be terminated in the event of OOM. At present, this proposal is still being solicited for comments (RFC).