Just turn off swap? You don't really need it, and the kernel wiil just oom kill without it.
post
Not sure if your distro version has a new enough version of systemd, but newer versions have a systemd-oomd service for that. It may not be enabled by default. On older versions you could try early-oom which is not part of systemd. OOM stands for Out-Of-Memory.
I think that systemd oomd is pretty slow. I get a quite a few minutes of unresponsive system while waiting for oomd to do something. Honestly rebooting is faster than waiting for it to work.
I recently installed and enabled earlyoomd on fedora, and on an initial test, I still got an unresponsive system with the default settings, but after around 20 seconds or so, it killed the responsible process and I was able to continue working. Not perfect, but much better.
if you can run it as its own dedicated user, you can set a RAM quota in /etc/security/limits.conf . it can share a group with your real user so both can access the same download dir etc..
good luck, commander
You could probably rig something up to periodically check RAM usage and if it's dangerously high, send a system notification - or make an xmessage popup - to tell you to restart Brave ASAP. That is, before the death loop begins in the first place.
You might also want to install an extension that unloads tabs that haven't been accessed in a while, especially if you're a tab hoarder.
I don't use Brave, so I'm making assumptions that such an extension exists and that Brave can be restarted without losing all tabs, etc.
Would changing swappiness make a difference ? https://wiki.archlinux.org/title/Swap#Swappiness
- For servers monit, a simple monitoring tool, can alert via email when CPU or RAM usage is too high. Is there something like that for desktops ?
This might help.
https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/
You could write a simple bash script to get memory and compare it to your desired memory usage then clear memory when desired usage has been exceeded. Then set your script as a cronjob.
Or you can just setup a cronjob to clear memory at a set interval in a cronjob described in the link.
all 14 comments