Respite from the OOM killer
Posted Oct 2, 2004 20:21 UTC (Sat) by giraffedata
In reply to: Respite from the OOM killer
Parent article: Respite from the OOM killer
In all cases I simply allocate sufficient swap to handle all my RAM and then some,
If by RAM you mean physical memory, as most people do, swapping doesn't handle RAM -- it handles virtual memory. So the correct calculation isn't amount of RAM plus something, it's (roughly) amount of virtual memory minus amount of RAM. And there's no practical way to put a limit on the amount of virtual memory. The best you can do normally is watch your swap space and when you see it approaching full, add more.
Just allocate enough swap at install time to accomodate your expectations.
I agree that is the policy for which Linux is designed. The OOM killer is specifically to handle the pathological case that your expectations are exceeded. That's always a possibility. Consider program bugs.
The question of what to do when, despite the sysadmin's best intentions, the system runs out of virtual memory resources, is a difficult one; the various approaches (kill the system, kill some memory-using process, fail any attempt to get more virtual memory, make new swap space, etc.) all have their advantages and disadvantages.
to post comments)