Code: Select all
# sync; echo 3 > /proc/sys/vm/drop_caches
free -m
.Code: Select all
# sync; echo 3 > /proc/sys/vm/drop_caches
free -m
.sync; sudo sysctl vm.drop_caches=3
Code: Select all
$ free -h
total used free shared buff/cache available
Mem: 15Gi 2,5Gi 2,9Gi 754Mi 9,9Gi 11Gi
Swap: 0B 0B 0B
$ sync; sudo sysctl vm.drop_caches=3
<time passes>
$ free -h
total used free shared buff/cache available
Mem: 15Gi 2,5Gi 11Gi 762Mi 1,3Gi 11Gi
Swap: 0B 0B 0B
Agreed, my jaw hit the floor when I saw the amount of swap space OP has given the machine. I have 14G of RAM, but I just created a 128M swap file. Don't you still need at least the amount of RAM in swap space if you use hibernation, or is that no longer a thing in Linux? I've always just used S3 sleep state.
swappiness
value to 10; it's usually set to 60 by default, which is almost always far, far too aggressive for many desktop users, from what I've seen all these years.Code: Select all
sysctl vm.swappiness
Code: Select all
sudo sysctl -w vm.swappiness=10
Me too, maybe a shed load of browser tabs or an NLE?
By "program cache size", do you mean swap space? If so, you would probably want to reduce how heavily that's used to reduce writes to a much slower storage device, like a HDD or SD Card. RAM is faster than even an SSD, presumably even an NVMe SSD. Not everyone will notice a difference in setting that value themselves. Anther reason, although arguably not so relevant these days, is some might do that to preserve the lifespan of SSDs.
swappiness
value of 60 is likely what the kernel developers consider acceptable to address everyone, but of course, the expected drawback from making something acceptable for everyone is that it's unlikely to be optimal for many. My justification for setting swappiness
to 10 is that it ensures good performance when there's enough RAM in the machine.Won't listen to me: When I set it up to 10, after reboot it sets it back to 60. I guess I'd have to edit some file to set it permanently but don't know where and how. Any advice appreciated. (:Termy wrote: ⤴Mon May 23, 2022 4:01 pm @OP: I suggest changing yourswappiness
value to 10; it's usually set to 60 by default, which is almost always far, far too aggressive for many desktop users, from what I've seen all these years.
First, check it's current value:You can set it to 10 with:Code: Select all
sysctl vm.swappiness
You can adjust it accordingly using a different number, if you want. By lowering that value, you'll effective reduce how often your swap space will be used, meaning you won't be hammering your drive so much and RAM will be given a higher priority.Code: Select all
sudo sysctl -w vm.swappiness=10
Ah, it worked, woohoo! Thanks much! (:
No problem; your message was anyway useful to me for making some first steps. Thanks!
Which is why it, hibernation, is disabled in Linux Mint by Default. It's been a thorn in Clem and the rest of the LM dev team for , I think, years to trying to get it to work correctly 100% (shrugs)Later i found out that hibernating in linux isn't as smooth as in windows
Never use
sudo
for graphical applications. Because you mess up your permissions that way.