Get the latest tech news
Memstop: Use LD_PRELOAD to delay process execution when low on memory
Memstop monitors available memory and waits until a configurable percentage of memory becomes available before allowing a program to start. - surban/memstop
A lightweight LD_PRELOAD shared object that delays process execution when system memory is critically low. Memstop is designed to prevent crashes caused by memory exhaustion in parallel processing systems. When loaded as a shared object (via LD_PRELOAD), memstop automatically runs before your application's and all subprocesses' main() functions.
Or read this on Hacker News