Since 2025-03-30 update, I am finding that my machine experiences a very high CPU load after unlocking the screen. The machine is unusable for up to half a minute, and it’s not swapping. My software mix hasn’t changed, but it is perhaps worth mentioning that I always have a couple thousand tabs open in a bunch of browsers.
There have recently been some incisive changes in how the most common browser engines — i.e. chromium
and firefox
— deal with browser plugins. With chromium
it was a matter of the switch from so-called Manifest 2 to Manifest 3, and with firefox
it was the expiry of an old root certificate.
It is therefore not unthinkable that certain browser plugins are now broken and that rendering the content of all of your tabs while passing it through your plugins first may indeed trigger the higher CPU load and/or delayed loading.
Hmmm, most (at least 90%) of those open tabs are in (obsolete) browser Pale Moon, and I haven’t updated it (or its extensions) in years.
Well, the only thing I can then think of is the number of browser tabs in and of itself.
Your machine may be swapping heavily, and this is a high-priority and CPU-intensive process.
Swapping was my first idea too, but I have gkrellm running, and I see it’s not swapping. Besides, the number of tabs hasn’t changed much over the years.
Sorry about my last post (which I’ve deleted). I just woke up & haven’t had my coffee yet (excuses, excuses). I forgot to check which desktop environment you were running before typing & posting my lengthy Plasma-specific reply.
No worries, I appreciate that you took the time to comment.
Now I’m coming to the conclusion you are right. I didn’t see the swapping because gkrellm stops updating during that time. I think the following lines illustrate the problem:
= sysctl vm.swappiness
vm.swappiness = 60
= cat /etc/sysctl.conf
#Ref https://askubuntu.com/questions/652337/why-are-swap-partitions-discouraged-on-ssd-drives-are-they-harmful
vm.swappiness=1
vm.vfs_cache_pressure=50
This shows that swappiness is 60, when, according to sysctl.conf, it should be 1.
WT?
The file /etc/sysctl.conf
does not exist on my system, although I do have several files under /etc/systctl.d
…
[nx-74205:/dev/pts/3][/home/aragorn]
[aragorn] > less /etc/sysctl.conf
/etc/sysctl.conf: No such file or directory
[nx-74205:/dev/pts/3][/home/aragorn]
[aragorn] > ls -l /etc/sysctl.d/
total 16
-rw-r--r-- 1 root root 16 Nov 25 2021 10-swappiness.conf
-rw-r--r-- 1 root root 26 Nov 25 2021 20-vfs_cache_pressure.conf
-rw-r--r-- 1 root root 34 Nov 25 2021 50-max_user_watches.conf
-rw-r--r-- 1 root root 15 Nov 25 2021 99-sysctl.conf
[nx-74205:/dev/pts/3][/home/aragorn]
[aragorn] >
I’m not 100% sure, but I seem to remember that configuration via a sysctl.conf
file directly under /etc
was dropped by upstream.
Therefore, if this is where you’ve defined the swappiness
value, then, given that the file is no longer being parsed, the kernel will instead use its built-in default, which is — indeed — 60
.
Right you are. According to sysctl.conf(5): “If you are using systemd-sysctl(8), refer to sysctl.d(5) and note that it won’t use the file /etc/sysctl.conf.”
I’ll fix this, and test to make sure this floats my boat. Note that it may take a couple days to do that properly, because it takes a while for the memory to be used up.
nano /proc/sys/vm/swappiness
set value at 10 ?
nano /etc/sysctl.d/99-sysctl.conf
vm.swappiness = 10
vm.vfs_cache_pressure = 50
Pointless to use nano
on that. /proc
is a virtual filesystem. It exposes kernel settings to userland via an abstraction in the form of directories and files.
You could of course do…
echo 10 > /proc/sys/vm/swappiness
… but that is exactly what sysctl
does after reading /etc/sysctl.d/99-sysctl.conf
, or — as on my system here — /etc/systctl.d/10-vm.swappiness.conf
.
I was paying attention because I was interested.
If you open that many tabs, it probably consumes not only main memory but also VRAM.
- floorp(firefox compatible)
- firefox
I happened to open 1997 tabs at once for testing during the maintenance process two weeks ago, and there were no problems in my environment. I don’t want to reproduce it, but it was fine. And I used snaper to restore home to the state before the test.
Just to elucidate on the solution. I believe the problem appeared when /etc/sysctl.conf went out of style due to a recent update. So now I set the necessary parameters as shown here:
= cat /etc/sysctl.d/10-swapping.conf
#Ref https://askubuntu.com/questions/652337/why-are-swap-partitions-discouraged-on-ssd-drives-are-they-harmful
vm.swappiness=1
vm.vfs_cache_pressure=50
I have at least 2500 tabs open in at least a dozen instances of various browsers. Initially, my 16GB RAM is sufficient to avoid swapping, but after a couple days the memory leaks add up, and I’m into swapping. However, now that swappiness is set correctly, it’s not a problem.
Thanks all for your help.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.