[systemd-devel] MemoryMax not working with `systemd-run --user` using hybrid cgroups hierarchy

Lennart Poettering lennart at poettering.net
Wed Nov 7 16:39:55 UTC 2018


On Mi, 07.11.18 15:28, Piotr Dobrogost (2018 at p.dobrogost.net) wrote:

> Hi
> 
> I run `systemd-run --user -p MemoryMax=100M /usr/bin/krusader` to limit
> memory usage but it seems the limit is not enforced as `cat /proc/$(pidof
> krusader)/status | grep VmRSS` gives "VmRSS: 389992 kB".

MemoryMax= requires the memory cgroup controller to work. And that
controller is only safe to delegate on cgroupsv2, not on cgroupsv1,
hence we don't do it there. This means user at .service can't get write
to access to it on cgroupsv1.

Note that on hybrid all contorllers are mounted as cgroupsv1, hence
hybrid is like legacy in this regard.

Or in other words, unless you go full unified you can't use MemoryMax
in user instances.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list