Steam for Linux

Steam for Linux

kwahoo Feb 16, 2013 @ 1:33pm
TF2, reducing swap usage - how-to
I noticed that the swap usage while I'm playing TF2 is too high. While I have 8GiB RAM, kernel tries massive swapping. TF2 loading and closing times are long etc.

I've reduced the "swappines" parameter http://en.wi from default 60 to 20:
sudo su -
echo 20 > /proc/sys/vm/swappiness

For permanent result add to /etc/sysctl.conf line:
vm.swappiness = 20
< >
Showing 1-5 of 5 comments
[Linux] unbridledExüberance Feb 16, 2013 @ 7:34pm 
That's odd. I've never seen my computer use more than a few kilobytes of swap ever (on Linux that is), and I have 4 GB of RAM. Have you modified your scheduler before? By default, it shouldn't be swapping out memory unless you haven't used it in a long time and the memory would be better spent on the filesystem cache (so, not very often).
Last edited by [Linux] unbridledExüberance; Feb 16, 2013 @ 7:34pm
RobbieThe1st [Linux] Feb 16, 2013 @ 11:31pm 
It depends on the situation etc. This is a common fix/tweak a lot of people end up doing, because -- especially on a game like TF2 where it might be minutes between loads -- the OS may well think the memory unused(as it hasn't been touched in minutes), yet we really /do/ care about it.
Whether cached files or swapping out unused ram is better really depends on the applications you want to run. On a server, the default is probably good enough. On a desktop, we don't want to be waiting(period), so I'd say it should be set to a fairly low value.
gutigen o) Feb 17, 2013 @ 8:54am 
Swap? What's that?

Unless you use suspend, you don't need swap if your ram is above 4GB. This is not Windows :)
[Linux] unbridledExüberance Feb 17, 2013 @ 1:40pm 
Ah, okay. It makes sense that it might swap it during loading. It shouldn't make any noticeable difference though, since it should stay in memory after the load is done. It's not like it's thrashing or anything.

Still, that's not a bad tip in general.

You can also disable swap entirely with
sudo swapoff -a
(and reenable it with swapon). A word of warning though: this may cause a kernel panic if you, for some reason, need more RAM at once than you have available. That shouldn't be a problem though if you have at least 4 GB.
do u even sex?? Oct 2, 2014 @ 12:58am 
Originally posted by gutigen o):
Swap? What's that?

Unless you use suspend, you don't need swap if your ram is above 4GB. This is not Windows :)
Actually swap can help even if you have more than 4 GB RAM because it frees up space for the disk cache—how much swap to disk cache is essentially vm.swappiness.
< >
Showing 1-5 of 5 comments
Per page: 15 30 50