Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

In Debian 6, how can I limit the total amount of memory (both resident set size and total virtual memory) that a user has access to?

I have tried setting limits via ulimit, but if a process spawns subprocesses, the subprocesses do not have their memory limited.

I have also tried setting limits via /etc/security/limits.conf, but these limits do not seem to apply to processes spawned from non-login shells, or to subprocesses.

share|improve this question

Squeeze supports cgroups if you install cgroups-bin. I've done this to limit memory for users, groups of users, and individual applications (e.g. emacs cannot go over 1G)


share|improve this answer
Thanks for the reply. The default kernel provided with Squeeze doesn't support memory cgroups - should I pull in the kernel from Wheezy or would that cause problems? – James Robinson Jun 21 '11 at 13:08

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.