Skip to content
A userspace out-of-memory killer
C++ Meson Other
Branch: master
Clone or download
htejun and facebook-github-bot oomd: senpai: implement safety disable mechanism for senpai
When running on old kernels w/ experimental pressure file format, some
total pressure info is not available.  If enabled on such machines,
senpai incorrectly thinks that there is never any pressure and will
clamp down memory.high to the min limit and can easily put the system
under extreme memory and io pressures.

Let's detect no total info condition and disable senpai.

Reviewed By: danobi

Differential Revision: D17366705

fbshipit-source-id: 2a782584118aa25ac692e347c8d1b68cd6e97c71
Latest commit 9e890cc Sep 14, 2019


Build Status

oomd is userspace Out-Of-Memory (OOM) killer for linux systems.


Out of memory killing has historically happened inside kernel space. On a memory overcommitted linux system, malloc(2) and friends usually never fail. However, if an application dereferences the returned pointer and the system has run out of physical memory, the linux kernel is forced take extreme measures, up to and including killing processes. This is sometimes a slow and painful process because the kernel can spend an unbounded amount of time swapping in and out pages and evicting the page cache. Furthermore, configuring policy is not very flexible while being somewhat complicated.

oomd aims to solve this problem in userspace. oomd leverages PSI and cgroupv2 to monitor a system holistically. oomd then takes corrective action in userspace before an OOM occurs in kernel space. Corrective action is configured via a flexible plugin system, in which custom code can be written. By default, this involves killing offending processes. This enables an unparalleled level of flexibility where each workload can have custom protection rules. Furthermore, time spent livedlocked in kernelspace is minimized. In practice at Facebook, we've regularly seen 30 minute host lockups go away entirely.

Installing from RPMs on Fedora

RPMs are currently available for Fedora 30+ from a COPR repository.

You can enable the COPR repository for oomd with:

$ sudo dnf copr enable filbranden/oomd

Then install oomd with:

$ sudo dnf install oomd

Finally, enable and start it with:

$ sudo systemctl enable --now oomd.service

Building from source

Note that oomd requires PSI to function. This kernel feature has been merged into the 4.20 release.

oomd currently depends on meson and jsoncpp. libsystemd is an optional dependency.

oomd also requires GCC 8+ or clang 6+. Other compilers have not been tested.

$ git clone
$ cd oomd/oomd
$ meson build && ninja -C build
$ cd build && sudo ninja install


See docs/ for a high level overview and some examples.

See docs/ for a quick reference on core plugin capabilities.

See docs/ for guidelines on how oomd should be set up in a production environment.

Running tests

oomd depends on gtest/gmock to run tests. Installing gtest/gmock from master is preferred.

If meson detects gtest/gmock is installed, meson will generate build rules for tests.

$ cd oomd
$ rm -rf build
$ meson build && ninja test -C build

Writing custom plugins

It is both possible and encouraged to write custom plugins. The codebase is designed to make writing plugins as easy as possible.

See docs/ for a tutorial.

Help / Discussion / Support

Join our #oomd channel on!


oomd is GPL 2 licensed, as found in the LICENSE file.

You can’t perform that action at this time.