Answer the question
In order to leave comments, you need to log in
How to limit process RAM by PID?
I heard about cgroup but did not find a command anywhere to limit the memory of a process.
Answer the question
In order to leave comments, you need to log in
You can try changing the RAM limit in the limits of the shell instance you are running the program from... see:
$ ulimit -Sm
unlimited
A couple of links on the topic about modern ways of manipulating groups in different distributions:
https://wiki.archlinux.org/index.php/Cgroups
https://www.digitalocean.com/community/tutorials/h...
Hardcore way with manual adding a group (memory:/test), limiting the memory in it (one megabyte) and moving the process ($PID) into it:
# mkdir /sys/fs/cgroup/memory/test
# echo 1048576 > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
# echo $PID > /sys/fs/cgroup/memory/test/tasks
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question