I'm wanting to use cgroups and systemd-run to insulate the rest of my system from rogue programs that wake the OOM killer.
In particular, clangd is hogging all my memory and then some, and then triggering the OOM Killer.
That's a separate problem and a separate question. (Although any answers welcome)
This question is about why my usage of systemd-run isn't working.
If I wrap it like so...
systemd-run --user --scope -p MemoryHigh=3G clangd --clang-tidy --malloc-trim --log=info --background-index -j 8 --pch-storage=disk --background-index-priority=low
It doesn't stop it from going hog wild and the OOM killer killing my gnome session and making me log in again!
I have tried MemoryMax=5G and it doesn't make a difference.
Details of my setup are....
- Ubuntu Noble 24.04 LTS
- clangd 18.1.3
- MemTotal: 16101600 kB
- SwapTotal: 5242876 kB
- Linux version 6.8.0-41-generic (buildd@lcy02-amd64-100) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 202
systemd-run --version systemd 255 (255.4-1ubuntu8.4) +PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified
References I'm using...