Let's say I have two processes. One critical and one nice to have process.
Now, let's say the nice to have process starts leaking memory. How can I stop the leaking process from using up all system memory and causing the critical one to crash or slow down?
I would like that the non-critical process simply terminate or throw std::bad_alloc
when it uses more memory than a certain threshold.