Preoomkiller
Softly kills your process with SIGTERM before it runs out of memory.
Install / Use
/learn @grosser/PreoomkillerREADME
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_bytesand/sys/fs/cgroup/memory/memory.stat
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
<!-- Updated by rake bump:patch -->
Build
- install rust
cargo build
Test
Tested with Ruby to have readable / expressive tests.
- Build
gem install bundler... needs ruby installedbundlebundle exec rake
Release
bundle exec rake bump:patchbundle exec rake release
TODO
- remove
regexdependency by splitting string and searching manually - travis + show status on crates.io
- kill child when process is killed (already has a failing test)
- find safe way of doing wait / kill ... http://stackoverflow.com/questions/35093869
- make
rake bumprelease for multiple targets and commit all changes - add
--signaloption ... support numbers and ideallyUSR1etc words - make percent a float
- add
--restartoption to not kill but restart ... maybe don't since this is tricky / needs a limit
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
