usable RAM and settings for tmpfs

So, i have 8GB RAM but notice paging starts before hitting 5GB used memory. I tried lowering vm.swappiness but this did not change the symptoms and caused other issues.

The next candidate is tmpfs which is set to 50% RAM by default.
1 - One question would be does this prevent full usability of RAM by applications?
Googling on how to change default size:
2 - https://tr.opensuse.org/SDB:Setting_the_Size_of_tmpfs_and_shmfs seems incorrect, i do not have file /etc/sysconfig/kernel on my system.
3 - looking for other avenues, i tried in fstab

tmpfs      /dev/shm      tmpfs   defaults,size=35%   0   0

but this leaves the other tmpfs drives unchanged, i tried the same for e.g. /run and /sys/fs/cgroup but this would not work

# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           2.7G   95M  2.7G   4% /dev/shm
tmpfs           3.9G  1.9M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           788M   16K  788M   1% /run/user/1000

4 - so how do i change the defaults? and would it improve usable RAM?

Where did you find that the system is swapping ? Seeing disk activity is not proof of swapping. Please show output of

free -h

Plus, where did you find that adjusting the system’s default is necessary.

so i have monitored swap from system monitor. i just did an experiment by opening multiple (ram hogging) gmail tabs from a cold boot and RAM utilisation no longer seems as bad as passive observation would suggest.

#free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        6.1G        153M        1.2G        1.4G        147M
Swap:          8.0G        1.5G        6.5G



my frustrations/investigations started with a (assumed) kernel update that caused very long e.g. 10 to 15min near freezing when using swap i.e. when using virtual box etc. looking at the results from a cold boot perhaps there’s nothing to improve.

Hi
So what processes are you running in the background… web server databases etc?

If just a DE, then it seems abnormal to me… I hardly ever see swap used with 4GB of ram…

Opened a whole heap of tabs on firefox…


 free -mh
              total        used        free      shared  buff/cache   available
Mem:           3.8G        1.3G        1.5G        128M        1.1G        2.2G
Swap:          4.0G          0B        4.0G

Shut firefox down;
 free -mh
              total        used        free      shared  buff/cache   available
Mem:           3.8G        697M        2.1G         81M        1.0G        2.9G
Swap:          4.0G          0B        4.0G

When you tweaked the swappiness…how was this done (I use this on the above system)? What abnormal things happened?

to try and answer your questions
1 - no real dedicated apps. I usually have a LOT of chrome tabs open, okular with MANY pdfs, and rarely use virtual box + minor apps.
2 - (im on plasma) lower than typical use i.e. right now

         total        used        free      shared  buff/cache   available
Mem:           7.7G        2.4G        3.4G        1.1G        1.9G        3.9G
Swap:          8.0G        1.4G        6.6G

The freezing issue occurred maybe ~6 times over say ~3 weeks (hasnt happened now for more than a week). Everything would freeze with only the mouse cursor moving with intermittent jerky motions etc.
i didnt get very far in finding a smoking gun for the freezes, i managed to get system monitor into the foreground a few times and noted disk activity processes (if i remember kswapd0 process).

3 - i set vm.swapiness in /etc/sysctl.conf starting at 10 and incremented back up to 60. The problem was specific to gradio (and i think the onset of swap). If gradio was playing when the freeze occurred it would continue to play and the freeze would continue without recovery. moving swapiness back to 60 fixed the problem.

they sound very similar and may be be interconnected but the swapiness/gradio freeze if i remember could be initiated very reliably near the onset of swapping.

sorry if i cant be more specific (it was a bad month, i also had extended freezing from ABP crashing in chrome). I can test the gradio/swapiness crash if you like to see if it has resolved?*

Hi
I use the following settings;


# Disable swap
vm.swappiness = 1
vm.vfs_cache_pressure = 50

I wonder if there are some chrome tweaks for caching etc?

If using btrfs, then it could be maintenance or quotas still enabled for the random freezing.