Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    You can't put memory restrictions on a user as a whole, only on each process. And you can't distinguish between RAM and swap usage. If you want finer control, run the user's processes in a virtual machine. Commented Mar 16, 2012 at 23:30
  • @Gilles pretty sure that virtual machines just use cgroups and namespaces, or derivatives of Commented Aug 15, 2014 at 0:38
  • @RapidWebs no they don't. They just emulate the predefined amount of RAM, and the guest OS then decides how to allocate it to the processes. Commented Aug 10, 2016 at 16:18
  • Containers (not virtual machines) use cgroups, to limit memory usage. Limiting virtual memory is not a good idea; A process can use a lot of virtual memory, but may only use a little RAM. For example my system has 34359738367 kB of virtual memory allocated, but much less ram. Commented Dec 10, 2018 at 20:12
  • related: stackoverflow.com/questions/437433/… | serverfault.com/questions/1036316/… | superuser.com/questions/394120/… Commented Oct 1, 2024 at 19:48