How to limit physical memory usage (RLIMIT_RSS)? #6757
-
|
Could you advise on how to effectively constrain the physical memory (RSS) usage in a sandbox environment? Through my testing, the --rlimit-as option appears to primarily limit virtual memory (AS). Might there be alternative configuration methods specifically targeting physical memory allocation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
CGroup memory controller is what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
There is no firejail command to do this. Edit: The following is wrong; see the comments below. Besides cgroups, it also seems to work with Example: $ prlimit --rss=1000 firejail sh -c 'sleep 1000'
[...]
Parent pid 10000, child pid 10001
[...]
$ prlimit --pid 10001 | grep RSS
RSS max resident set size 1000 1000 bytes |
Beta Was this translation helpful? Give feedback.
CGroup memory controller is what you're looking for.