Script to disable the OOM killer on certain processes

# on February 19th 2010 at 9:17 am in Computers & Hardware,HOWTOs,Software

My LinuxSampler set-up was having odd crashes lately. Took a while to figure to they were caused by the OOM killer killing the process. (Granted, not weird if you only have 256MB of RAM…)

Quite annoying, I do not want that process to die (nor the “jackd” process).

After having stumbled upon this page about the OOM killer, I wrote this little script, which I run just after jackd and linuxsampler have set-up (as root of course).

It’ll write the value -17 (OOM_DISABLE) to /proc/<pid>/oom_adj for selected process-names and this ought to prevent the OOM killer from ever targeting that process.

Haven’t seen it crashing on me since — but of course, your mileage may very… :)

- Navaho Gunleg
comment on this article

Notice: All comments are moderated. Your comment will appear once approved.

© 2005-2012. All remarks and opinions on this site are the intellectual property of Navaho Gunleg, unless specified otherwise. If you find anything offensive or otherwise insulting, just close the damn window; there are far more serious issues in this world to get upset about.