I’ve been trying to compile the kernel (as some sort of benchmark of my system’s performance) but then stumbled upon an strange behavior: the system insists on not touching and using swap at all, and dying with OOM.
But a small cpp binary which simply leaks memory by allocating in a loop without a call to delete, eventually forces the system to use the swap. It’s just the make -j in kernel directory that doesn’t like the swap. Yet, for the cpp binary, even though I set the swappiness to 99, the system doesn’t go to swap until the ram is 99% full.
Do you know what am I doing wrong?
Here are the relevant configurations:
/etc/fstab:
...
UUID=THE_UUID none swap defaults 0 0
uname -a:
Linux myhostname 5.17.0-1-MANJARO #1 SMP PREEMPT Mon Mar 7 08:29:54 UTC 2022 x86_64 GNU/Linux
Other things I’ve tried, out of despair, so some might sound silly:
Install a fresh Manjaro, using ext4.
Install a fresh Manjaro, using btrfs.
Use swap in a dedicated partition.
Use swap in a swap file on ext4.
Use swap in a swap file on btrfs.
Use dd to allocate the swap file instead of fallocate.
I’m trying to compile the kernel, as a measure of my new systems performance compared to old one. (I’m not interested in the result of compilation per se). I am now a bit side tracked though: there might be other ways of benchmarking, but now I’m curious about why I can’t compile the kernel!
I had the same issue with make -j 4 yesterday (or no -j at all, using one core).
Then today following your advise I started building the Manjaro’s provided kernel, with makepkg (which interestingly, uses nproc+1 according to makepkg.conf) and the issue is gone! the memory usage stays around 4GB all the time, and it’s utilizing all the 24 cores. nice!
I think now this is better asked in kernel mailing list, it’s rather not related to Manjaro why mainline kernel is behaving crazy. (or perhaps I should study the Manjaro patches + build / makepkg files see what’s the difference).
I’ll mark this post as solved.
Thanks for the support!