Is there a way to tell Fedora when to use swap?

I have a laptop with 16GB of ram, most just using music, videos, and browsing the web. Sometimes on Firefox I’ll have a dozen or more tabs open and most websites I visit aren’t super draining. But when I open up say 15 or more tabs on Youtube (they haven’t loaded yet, and autoplay is disabled), I see under System Monitor that my system is starting to use up it’s swap memory. I was just wondering if there was a way to increase the limit or threshold that Fedora will start using swap? I don’t usually go passed 40-50% of my 16GB of ram used, yet sometimes Fedora will tap into the swap memory. I’d like to increase it if I can (safely of course), but I don’t know if there is a way to do this easily or no? Appreciate any help, thank you.

Below is a screenshot, when I have 15 YouTube tabs open, and my system starts to eat up in Swap memory. I’d rather my system didn’t do this so soon when I have only used 45% of my ram at the time.

Edit: Ideally, I’d like Fedora not to use my Swap unless my system is literally about to freeze or something.

This is normally not a problem since swap uses zram by default:
Changes/SwapOnZRAM - Fedora Project Wiki

1 Like

I don’t know how you would do this, but I have to ask: why would you?

The linux kernel has algorithms to make sure that memory is available when needed.
It is rare to need to tune a desktop system as the defaults work very well.

Without a specific problem you need to tune for there is no need to change anything.

It is not unusual to see small amounts of swap be used from time to time.
It does indicate a problem it is the kernel working as designed.
You system may have seen high memory usage for a very short time; less then a second say.

Yup! There is a “swappiness” setting you can tune in the kernel, but it’s honestly not worth touching on this side of zram.