Escape the death of the OOM killer in Linux

Waxhead

Doing a bit of research I found it it is possible to tune or even make certain processes immune against the OOM killer by poking a value into /proc/pid/oom_adj I do of course need to find pid for my process using pidof or pgrep or something like that and make a script that I run once all my processes are up and running.

The problem with the OOM killer is just like with any other killer. It may look sane and rational on the surface but deep down they are in fact seriously disturbed, quite insane and often incapable of making a correct judgement.

Now I personally don't mind a little killing as long as I know what is going on and have a certain control over the victims (calm down folks, I am talking about the computer stuff) so I am looking for a better way to protect certain processes against the dreadded OOM killer so that I don't have to run a script everytime all my progs are running or whenever I start a new program. Any ideas to how to easily achieve this?

haimg

You should not be relying on OOM killer to manage your processes. OOM killer is a measure of last resort, when the only other alternative is a system crash. E.g. all cache and disk buffers memory was flushed and committed, everything that can be swapped out/discarded is processed, and you still don't have enough memory... Obviously you don't want your running system to ever reach this state.

Because of the strict constrains that OOM killer operates under (cannot allocate more memory, cannot swap in other processes, etc.), it will kill processes you don't want to be killed to relieve memory pressure.

I think if your system just doesn't have enough memory, you need to add more memory or swap space, depending whether you're running out of physical memory or total virtual memory.

If, on the other hand, you have a few runaway processes that consume too much memory from time to time, due to a memory leak or some other bug, you can control that via other means:

  1. Set ulimit -m before starting the offending process and limit how much memory that process can allocate.

  2. Restart the offending process gracefully on a schedule via cron, if there is a memory leak and it is fairly predictable.

In any case, OOM killer is not your friend, it's a loose cannon :-/

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

OOM killer not working?

分類Dev

Linuxでoom killerを無効にする方法は?

分類Dev

Why does linux out-of-memory (OOM) killer not run automatically, but works upon sysrq-key?

分類Dev

AWS RDS with Postgres : Is OOM killer configured

分類Dev

Why is the OOM killer killing processes when swap is hardly used?

分類Dev

Ubuntu 18.04 OOM Killer keeps getting invoked, but I can't find any sign of out of memory

分類Dev

十分なRAMを備えたOom-killer(メモリ不足)(?!)-inotify

分類Dev

Is it possible for a userland process to handle OOM error in linux?

分類Dev

十分なRAMが使用可能であるにもかかわらず、メモリの断片化が原因でユーザープロセスがLinux OOM-killerを呼び出すことができるのはなぜですか?

分類Dev

SVNは最大512MBを超えるファイルを転送しません(OOM Killer)

分類Dev

OOM-killerがリソースホッグを殺せないことがあるのはなぜですか?

分類Dev

OOM Killerメモリ統計レポートの略語はどういう意味ですか?

分類Dev

oom-killerがキックインする根本的な理由を理解するのに役立ちます

分類Dev

escape whitespaces in linux path and file names

分類Dev

Ubuntu 18.04 OOM Killerが呼び出され続けますが、メモリ不足の兆候が見つかりません

分類Dev

OOM-Killerは、要求が多すぎるプロセスを強制終了できないのはなぜですか?

分類Dev

Ubuntu 18.04 OOM Killerが呼び出され続けますが、メモリ不足の兆候が見つかりません

分類Dev

linux-OOM /スワップは使用されていません

分類Dev

How to check Regex for character / (escape slash) and ^ Using Shell Scripting Linux

分類Dev

Linuxヘッダーを4.4.0-53に更新した後のWifi(Killer 1535)の問題

分類Dev

独自にoom_killを呼び出すようにLinuxを構成する方法

分類Dev

Linux OOMキラーによって強制終了されたプロセスを見つける

分類Dev

Linux 64スワップが空ではなく、OOMがアプリケーションを強制終了する

分類Dev

Linux OOMキラーがプログラムを終了するのはなぜですか?

分類Dev

Diamond of death and Scope resolution operator (c++)

分類Dev

Stop death animation after respawn in Unity

分類Dev

Google TestのEXPECT_NO_DEATH()

分類Dev

Plot death count against date with Matplotlib

分類Dev

ユーザーランドプロセスがLinuxでOOMエラーを処理することは可能ですか?

Related 関連記事

  1. 1

    OOM killer not working?

  2. 2

    Linuxでoom killerを無効にする方法は?

  3. 3

    Why does linux out-of-memory (OOM) killer not run automatically, but works upon sysrq-key?

  4. 4

    AWS RDS with Postgres : Is OOM killer configured

  5. 5

    Why is the OOM killer killing processes when swap is hardly used?

  6. 6

    Ubuntu 18.04 OOM Killer keeps getting invoked, but I can't find any sign of out of memory

  7. 7

    十分なRAMを備えたOom-killer(メモリ不足)(?!)-inotify

  8. 8

    Is it possible for a userland process to handle OOM error in linux?

  9. 9

    十分なRAMが使用可能であるにもかかわらず、メモリの断片化が原因でユーザープロセスがLinux OOM-killerを呼び出すことができるのはなぜですか?

  10. 10

    SVNは最大512MBを超えるファイルを転送しません(OOM Killer)

  11. 11

    OOM-killerがリソースホッグを殺せないことがあるのはなぜですか?

  12. 12

    OOM Killerメモリ統計レポートの略語はどういう意味ですか?

  13. 13

    oom-killerがキックインする根本的な理由を理解するのに役立ちます

  14. 14

    escape whitespaces in linux path and file names

  15. 15

    Ubuntu 18.04 OOM Killerが呼び出され続けますが、メモリ不足の兆候が見つかりません

  16. 16

    OOM-Killerは、要求が多すぎるプロセスを強制終了できないのはなぜですか?

  17. 17

    Ubuntu 18.04 OOM Killerが呼び出され続けますが、メモリ不足の兆候が見つかりません

  18. 18

    linux-OOM /スワップは使用されていません

  19. 19

    How to check Regex for character / (escape slash) and ^ Using Shell Scripting Linux

  20. 20

    Linuxヘッダーを4.4.0-53に更新した後のWifi(Killer 1535)の問題

  21. 21

    独自にoom_killを呼び出すようにLinuxを構成する方法

  22. 22

    Linux OOMキラーによって強制終了されたプロセスを見つける

  23. 23

    Linux 64スワップが空ではなく、OOMがアプリケーションを強制終了する

  24. 24

    Linux OOMキラーがプログラムを終了するのはなぜですか?

  25. 25

    Diamond of death and Scope resolution operator (c++)

  26. 26

    Stop death animation after respawn in Unity

  27. 27

    Google TestのEXPECT_NO_DEATH()

  28. 28

    Plot death count against date with Matplotlib

  29. 29

    ユーザーランドプロセスがLinuxでOOMエラーを処理することは可能ですか?

ホットタグ

アーカイブ