Prevent KDE from swapping

0

I've realized that my laptop was overheating as a result of lots of I/O, so I searched for the programs who used swap, and I found the following:

$ pgrep kwin
13387
$ pgrep plasma-desktop
13424
$ cat /proc/13387/status | grep -i swap
VmSwap:    30112 kB
$ cat /proc/13424/status | grep -i swap
VmSwap:    49048 kB

I still have some memory left:

$ free
              total        used        free      shared  buff/cache   available
Mem:       16409376     6714148     3616732      240372     6078496     9096276
Swap:      18513916     1092872    17421044

If possible to configure, I'd rather KDE be slow, than use up more swap.


Video driver info:

01:00.0 VGA compatible controller: NVIDIA Corporation GF116M [GeForce GT 560M] (rev a1)
    Subsystem: ASUSTeK Computer Inc. Device 204b
    Kernel driver in use: nvidia
    Kernel modules: nouveau, nvidia

wvxvw

Posted 2015-07-01T22:52:56.087

Reputation: 803

kwin's and plasma-desktop's performance and resource usage depend greatly on display drivers. What's your GPU, and which driver are you using (open/proprietary)? – Larssend – 2015-07-01T23:13:16.470

@geewee oh, I didn't think about it, well, it seems like it's using Nouveau driver, I'll try to replace it with Nvidia's proprietary one and see if there will be any difference. (added that info to the question). – wvxvw – 2015-07-02T07:04:37.627

Bah, I looked into the wrong line. Nope, I'm not using Nouveau, though just for the record, I've restarted the system and now neither kwin nor plasma desktop don't swap. It must happen some time during the exploitation that they require more memory and then don't let it go? – wvxvw – 2015-07-02T07:46:21.887

Try to set vm.swappiness=1? this will affect all processes though but shouldn't be a problem with your 16GB RAM. – Chris.C – 2015-07-02T08:10:34.187

Thanks for the suggestion, @Chris.C, that indeed would've been an option otherwise, but one of the reasons I have this much RAM is that every now and then I use some statistical programs (R and Python), where I'm OK with eventually exceeding the quota (since that's usually for a good cause). I'm not sure yet, but it seems like once in a while, when something like this happens, KDE will also begin swapping and even after the original cause is no more, will still use the swap (but this is just a guess). – wvxvw – 2015-07-02T08:59:23.047

When setting it to 1, the swap is still there and the system will use swap only when necessary(for kernel > 3.5). This is a safe option and worth trying swappiness=1 : Version 3.5 and over: Minimum swappiness without disabling it entirely – Chris.C – 2015-07-02T09:30:56.413

No answers