grosser / preoomkiller

Softly kills your process with SIGTERM before it runs out of memory.
MIT License
75 stars 10 forks source link

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

Written in Rust to consume minimal resources.

Version: 0.2.0

Usage

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.current or
                        /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

Build

Test

Tested with Ruby to have readable / expressive tests.

Release

TODO