Softly kills your process with SIGTERM before it runs out of memory.
Ruby Rust
Latest commit dbc1e50 Jan 23, 2017 @grosser switch to whilelist include
Failed to load latest commit information.
src move to standard location Jan 23, 2017
target/x86_64-apple-darwin/release compile Jan 22, 2017
test fail fast and helpful when files do not exist Jan 23, 2017
.gitignore compile Jan 22, 2017
Cargo.lock done Jan 22, 2017
Cargo.toml switch to whilelist include Jan 23, 2017
Gemfile tests Jan 22, 2017
Gemfile.lock bump Jan 22, 2017
Rakefile update Jan 23, 2017 update Jan 23, 2017

Softly kills your process with SIGTERM before it runs out of memory.

  • Made for processes that run inside docker.
  • defaults to /sys/fs/cgroup/memory/memory.usage_in_bytes and /sys/fs/cgroup/memory/memory.stat

Written in Rust to consume minimal resources.

Version: 0.0.1


Download the binary you need from target/your-arch or cargo install preoomkiller.

Usage: target/debug/preoomkiller [options] args

    -m, --max-memory-file PATH
                        set file to read maximum memory from
    -u, --used-memory-file PATH
                        set file to read used memory from
    -i, --interval SECONDS
                        how often to check memory usage
    -p, --percent PERCENT
                        maximum memory usage percent
    -h, --help          print this help menu
    -v, --version       show version



Tested with Ruby to have readable / expressive tests.

  • Build
  • gem install bundler ... needs ruby installed
  • bundle
  • bundle exec rake


  • bundle exec rake bump:patch
  • bundle exec rake release


  • remove regex dependency by splitting string and searching manually
  • travis + show status on
  • kill child when process is killed (already has a failing test)
  • find safe way of doing wait / kill ...
  • make rake bump release for multiple targets and commit all changes
  • add --signal option ... support numbers and ideally USR1 etc words
  • make percent a float
  • add --restart option to not kill but restart ... maybe don't since this is tricky / needs a limit