Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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