Consider a system with limited memory, like a smallish VPS. Suppose there are a handful of processes that need to stay alive, and one process "P" that would be nice to have around, but is not strictly necessary. What I'd like do is keep P around under times of low activity, but when activity picks up beyond a certain threshold, kill off P until activity lowers again, at which time I want P to come back. I'm not sure yet what I'd like "activity" to mean, but it could be any of: memory usage, swap usage, server load values.
I'm already using Monit, so it would be good if this could be accomplished with Monit. Bear in mind that I don't mean process memory usage, I mean overall system load. I don't have to use Monit for this, though, if something else will do the job.