I read this question and tried the methods suggested.
I edited \etc\cgconfig.conf
like this:
group memlimit {
memory {
memory.limit_in_bytes = 21474836480;
}
}
and /etc/cgrules.conf
user1 memory memlimit/
but it does not work.
Using /etc/security/limits.conf
abort the process with larger than memory threshold. I just want the process alive and send it to swap.
I am using Ubuntu, 18.04LTS OS.
I already installed
apt install cgroup-tools
.
Here suggest to use GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
and update grub. Is it safe to update grub?