0

i want to use cgroup to manage memory of specific processes. I install cgroup-tools, enabled the memory controller in /etc/default/grub with GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1" after this is update-grub. created a group

cgcreate -g memory:1024

set my limit

 cgset -r memory.limit_in_bytes=1G 1024

and put the running process pid with cgclassify to the group

cgclassify -g memory:1024 $( pidof myprocess )

The process is ignoring the Limit, but the pid is in memory/1024/tasks Where is my mistake?

  • What does /etc/cgrules.conf look like? – Raman Sailopal Apr 24 '18 at 12:41
  • my /etc/cgrules.conf group 1024 { memory { memory.limit_in_bytes = "3G"; } } – Eugen Apr 24 '18 at 12:47
  • But you're trying to set it to 1G? – Raman Sailopal Apr 24 '18 at 13:12
  • i set now the cgrules.conf to 'group 1024 { memory { memory.limit_in_bytes = "1G"; } }' still the same problem. The running processes are using 1,6G and 2,6G, with the given limits. – Eugen Apr 24 '18 at 13:21
  • Try amending the /etc/cgrules.conf file directly – Raman Sailopal Apr 24 '18 at 13:26

Your Answer

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

Browse other questions tagged or ask your own question.