Crates.io | preoomkiller |
lib.rs | preoomkiller |
version | 0.1.0 |
source | src |
created_at | 2017-01-23 03:35:30.345571 |
updated_at | 2021-11-02 03:04:52.691353 |
description | Softly kills your process with SIGTERM before it runs out of memory. |
homepage | https://github.com/grosser/preoomkiller |
repository | |
max_upload_size | |
id | 8190 |
size | 14,522 |
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.1.0
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, default:
/sys/fs/cgroup/memory/memory.stat
-u, --used-memory-file PATH
set file to read used memory from, default:
/sys/fs/cgroup/memory/memory.usage_in_bytes
-i, --interval SECONDS
how often to check memory usage, default: 1
-p, --percent PERCENT
maximum memory usage percent, default: 90
-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
bundle exec rake release
regex
dependency by splitting string and searching manuallyrake 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