When I configure the vm.watermark_scale_factor
property in /etc/sysctl.conf
which is the property in charge of indicating to the kernel when the kswapd
daemon starts to activate for paging from ram to disk, something happens that I can't find an explanation for: it increases the consumption of ram memory.
If I leave its default value which is 10, that is, kswapd
is activated when it has 0.1% of memory available, the conky tells me that the computer boots with 1.2gb of ram consumption; but if, for example, I set it to 1000, which is its maximum value, the consumption starts with 2.9 and 3gb without opening anything at all.
I have tried this in the Liquorix kernel that I use and also in the Debian one with the same result. Also when I used Linuxmint, I remember that the consumption also increased when the value of that property increased by 200.
I set this property to 270, because I notice that when it is set to that value, when the exchange begins the PC does not suffer from slowness. If I leave it by default at 10, the exchange causes a small paralysis of 10 to 15 seconds.
To recap, if I leave this property by default at 10 it consumes 1.2gb. If I set it to 270 it consumes 1.7gb and if I set it to 1000 it consumes 2.9-3.0gb without opening any application. I check in the system monitor and there is no process with a high consumption of ram
The first thing that comes to mind is that it is a general bug in the kernel.
Why does the consumption increase if this property is only to activate the kswapd
swap daemon?
With vm.watermark_scale_factor=270:
$ free -h
total used free shared buff/cache available
Mem: 5,7Gi 933Mi 3,8Gi 21Mi 1,0Gi 4,1Gi
Swap: 4,8Gi 0B 4,8Gi
With vm.watermark_scale_factor=1000:
$ free -h
total used free shared buff/cache available
Mem: 5,7Gi 1,1Gi 3,6Gi 39Mi 1,0Gi 2,9Gi
Swap: 4,8Gi 0B 4,8Gi
Image for vm.watermark_scale_factor=1000:
the same shows the system monitor. All that consumption without opening anything.