Softly kills your process with SIGTERM before it runs out of memory.
/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
Options: -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 ```
cargo build
Tested with Ruby to have readable / expressive tests.
gem install bundler
... needs ruby installedbundle
bundle exec rake
bundle exec rake bump:patch
cargo build --release
target/release/preoomkiller
binaryrake bump
release for multiple targets and commit all changes--signal
option ... support numbers and ideally USR1
etc words--restart
option to not kill but restart ... maybe don't since this is tricky / needs a limit