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.


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)

q.v. https://hydra.geht.net/tino/english/faq/debian/squeeze/cgroups/

  • 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? – user75046 Jun 21 '11 at 13:08

Your Answer

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