0

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:

enter image description here

the same shows the system monitor. All that consumption without opening anything.

1 Answer 1

0

The vm.watermark_scale_factor property in the Linux kernel controls how the kernel manages the available RAM in the system. Increasing the value of this property sets a higher threshold for memory usage before the kernel begins to release inactive memory or file cache in the system. This higher threshold means that the kernel will retain more memory in cache before releasing it.

Therefore, if you increase the value of the vm.watermark_scale_factor property, you may notice an increase in RAM consumption in the system, as the kernel will be retaining more memory in cache. This can be especially noticeable in systems with limited available RAM, where the increase in RAM consumption may make the system feel slower or even lead to a memory shortage (in extreme cases).

However, it is important to note that the increase in RAM consumption can also lead to an improvement in system performance, as the kernel can access cached data more quickly and, therefore, applications can run more quickly. Overall, the configuration of the vm.watermark_scale_factor property should be carefully adjusted according to the needs and resources of the system to ensure a proper balance between performance and memory availability.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .