Index Share
Strength: 0

Linux: prevent swapping and clogging of memory (Text)

Linux on desktop has some memory management problems: the memory is not reclaimed and after some time your free memory shrinks and shrinks. The reason for this is that Linux is more written for servers.
Here it is better to not free the memory and cache more because most tasks are repetitive.

But the bright side:
there is a parameter in the linux kernel which enables page reclaims, but is off by default:
This parameter uses three bits for different reclaim methods: pages, pages to write (disk buffer), swap (moves swap to main memory)
I use the mode 7, which activates all of them.
You can set this mode with:

sysctl vm.zone_reclaim_mode=7

or persist the setting in /etc/sysctl.d/99-sysctl.conf (you can create the file if it does not exist)



Select Token