百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
O

oomd

> 编程语言
开源

一个用户空间的内存耗尽杀手

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个用户空间的内存耗尽杀手

oomd

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

Background

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 to 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 livelocked in kernelspace is minimized. In practice at Facebook, we've regularly seen 30 minute host lockups go away entirely.

Installing on Debian 11+ or Ubuntu 20.04+

# apt install oomd

Installing from RPMs on Fedora

oomd is packaged in Fedora as of Fedora 32 and can be installed 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 requires a compiler and standard library with C++20 support.

$ git clone https://github.com/facebookincubator/oomd
$ cd oomd
$ meson build && ninja -C build
$ cd build && sudo ninja install

Configuration

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

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

The default Meson build includes the public plugin set. Run oomd --list-plugins on your built binary to list the enabled plugins.

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

Running tests

oomd depends on gtest/gmock to run tests.

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/writing_a_plugin.md for a tutorial.

Reporting bugs

Use GitHub issues to report public bugs.

License

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

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •C++

> 标签

C++

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言