Why Debian is not using swap as it should, and computer gets really slow when RAM is full or almost full?
Hello, people,
I have Debian installed in 2 computers. One has 15,5GiB of RAM, and a smaller disk, so i made a swap partition of "only" 15,9GiB. The problematic one has a bigger disk, but a fairly small RAM of only 3,8GiB; but i gave it a much bigger swap partition of 59,6GiB. And the problematic one has an SSD disk, so, for the common uses i do with it, it should not be noticeable. But today, browsers usually grow a lot in memory, as i use them: open and close tabs, of several sites, with videos, images, and all complex things a site can have. This happens in both computers. In the first one, with more RAM, when RAM is full, and swap also is almost full, i close and reopen a few programs. This will make a lot of memory be freed - and the one with the biggest memory usage is always the browser. But the problematic computer gets reeeeeeeeeeeeally really slow with a lot of swap still being free! This issue has existed for several months, i just have not taken the time to ask about it here. I tried to search the web for this problem, and possible solutions, but found no good result with my searches. I imagine some configuration of Debian, or the kernel, or whatever thing i know very little or nothing about. Can you help me here? |
Have a look at your swappieness setting. See this link for guidance.
-->https://linuxize.com/post/how-to-cha...alue-in-linux/ Use the free command to display free memory and free swap space. Keep in mind you can always add a swap file to swap space. |
Quote:
|
Yes, higher number for swappieness. That makes the system swap more aggresifly. Other things to consider, is the web browser you are using. Some are know to fill up more ram. It can be related to the specific release of a browser as well.
What is the free command telling you on the 2 systems? |
You might want to give zram a try.
https://docs.kernel.org/admin-guide/blockdev/zram.html https://wiki.archlinux.org/title/Zram https://pimylifeup.com/raspberry-pi-zram/ Works great on my pi400. Code:
*free |
Quote:
Quote:
Code:
$ free -h # This is the good behaviouring computer # First, I executed the command: $ sysctl vm.swappiness=80 # To make the above change permanent, I also edited the file: /etc/sysctl.conf # adding the line below to it: vm.swappiness=80 # And i used another command that was in the page sent above, # and now its output is 80, reflecting the change of the # command just made: $ cat /proc/sys/vm/swappiness 80 The browser i prefer is Vivaldi. But i have heard that any current browser will end up using a lot of RAM, if it stays openned for a lot of hours (which is always the case when i restart it to free memory). Vivaldi is based on Chromium, as other browsers i would like to use {except "chorume (meanings 1, 4 or 5)"}, which i will never use. Is there a browser with minimal memory usage, which can discard everything without needing to close+reopen it? |
You going to have to experiment with different browsers. Keep an eye on the with free on the system that fails.
It is possible there is another issue we are not aware of. How much free space do you have on your root partition? Insufficient space can cause problems like you describe. |
Quote:
The root partitions have a lot of space in both computers: 13GiB¹ in the good computer. And 216GiB¹ in the one with the problem here. ¹→ Is df -h output correct, as International System of Units/Sistema Internacional de Unidades, ou S.I., (in portuguese) says? The free -h command already is. |
Let's see these.
Code:
grep -e "." /proc/sys/vm/over* |
I'm guessing that it may be something to do with systemd, I use Devuan myself, & I don't get any such problems running Firefox-esr on my machines that only have 4GB ram & no swap space....
(Devuan is a systemd free version of Debian....& I'm not here to bash systemd, just suggesting that it might have something to do with the problem at hand). |
What a ridiculous suggestion - on zero evidence. Maybe it's the network manager, or the text editor in use.
:sheesh: |
Quote:
His system has the problem - mine doesn't! :hattip: |
Take a look at https://wiki.archlinux.org/title/Imp...torage_devices
https://wiki.archlinux.org/title/swap I have this in /etc/sysctl.conf : Code:
# Manual settings - these settings are to optimize for SSD drive And /etc/fstab Code:
proc /proc proc defaults 0 0 |
Quote:
# Good computer $ grep -e "." /proc/sys/vm/over* /proc/sys/vm/overcommit_kbytes:0 /proc/sys/vm/overcommit_memory:0 /proc/sys/vm/overcommit_ratio:50 $ grep -e "^Comm" /proc/meminfo meminfo $ grep -e "^Comm" /proc/meminfo meminfo $ grep -e "^Comm" /proc/meminfo CommitLimit: 24831676 kB Committed_AS: 27777048 kB $ # Bad computer, which is in a fairly slow situation, right # now. I am not using it much, today, so, we can test it # in some things that need this happening (if they exist). $ grep -e "." /proc/sys/vm/over* /proc/sys/vm/overcommit_kbytes:0 /proc/sys/vm/overcommit_memory:0 /proc/sys/vm/overcommit_ratio:50 $ grep -e "^Comm" /proc/meminfo CommitLimit: 64473816 kB Committed_AS: 11112736 kB $ Meaningful? |
Quote:
|
All times are GMT -5. The time now is 07:05 PM. |