You are not logged in.

#1 2020-11-09 18:29:37

RubenKelevra
Member
Registered: 2013-03-01
Posts: 41

swap stays filled for no reason

Hey guys,

I have a system monitor on my taskbar in KDE and notices a weird behavior lately(?). I use a memory intense java program - JOSM - and the memory consumption is like 60-70% peak (at 12 Gigs of memory).

The system starts swapping out stuff - which is fine for me.

But after closing all apps and having nothing major running in the background, the swap is still more than half full (3.5 GB of 4GB). Which is weird.

I let the system swap off and swap on again, and the memory consumption actually *dropped* another like 5% while swapping off and after swapping on there's nothing added to the swap again.

So something obviously got swapped off which is actually no longer needed and the kernel only realized that when I was calling swap off.


Did someone experience this behavior too? Is there anything I can do against that?

I'm using Kernel 5.9.1-zen2-1-zen.



Best regards

Ruben

Offline

#2 2020-11-09 19:57:25

mpan
Member
Registered: 2012-08-01
Posts: 1,599
Website

Re: swap stays filled for no reason

Why would system waste time on pulling things from swap if they are not needed and it can employ RAM for something useful?


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2020-11-09 21:37:30

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,464

Re: swap stays filled for no reason

RubenKelevra wrote:

I let the system swap off and swap on again, and the memory consumption actually *dropped* another like 5% while swapping off and after swapping on there's nothing added to the swap again.

So, does disabling and re-enabling the swap free your memory (RAM)?
Weird, but may still be a feature if the ram was not full.

Last edited by kokoko3k (2020-11-09 21:38:28)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2020-11-09 22:14:24

mpan
Member
Registered: 2012-08-01
Posts: 1,599
Website

Re: swap stays filled for no reason

For that it would be useful to see the output before, between and after the calls to swapoff/swapoff:

vmstat -s

In particular the “swap cache” line.

Last edited by mpan (2020-11-09 22:14:35)


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

Board footer

Powered by FluxBB