I am the unpopular guy who has brought down our high-memory linux machine twice this past week because some processes I have been running ate up way more ram then expected. One way around this would be to set a per process ulimit so if each process goes over a certain amount of ram usage that process will be killed. Sometimes though I need lots of ram for a single process rather than some ram spread out over a bunch of parallel processes. Rather than relying on me remembering to actively manage my ulimits whenever I run a different kind of job at a different level of parallelism, is there some kind of equivalent to ulimit that looks at the summed ram usage for a user, and then kills all or some of that user's processes rather than sinking the whole system?


This is almost exactly why Linux control groups (cgroups) were invented. This allows a group of processes (for example, all the processes decending from your initial interactive login) to be treated as a single entity for purposes of resource control -- such as limiting the total amount of memory consumed (or cpu resources, etc).


Cgroups are relatively new, and convenient support for them is largely missing in most distributions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.