Mailinglist Archive: opensuse-support (97 mails)

< Previous Next >
Re: [opensuse-support] swap starts being filled after upgrading to snapshot 20181116 of openSUSE Tumbleweed
  • From: H Zeng <zhx@xxxxxxxxx>
  • Date: Mon, 19 Nov 2018 08:21:50 +0800
  • Message-id: <4285339.knPBCD2lT0@ostp>
On Monday, 19 November 2018 03:05:13 HKT Carlos E. R. wrote:
On 18/11/2018 15.05, H Zeng wrote:
Hello everyone,

I have 24GB memory and 'vm.swappiness=1' enabled. But the swap space has
been used, although only a little, lately after upgrading to snapshot
20181116 of openSUSE Tumbleweed. The swap was always empty before this.
Does anyone know the reason? What should I do to avoid using swap
unnecessarily?

Here is the current memory usage,
```
cnzhx@ostp:~> free -m

total used free shared buff/cache

available
Mem: 23986 8481 1662 4897 13841
10243
Swap: 2051 5 2046
```

Instead, you can use "top", then press 'f' to choose sorting by swap
('s' to fixate, 'q' to exit to display mode).

That way you can find out if a process is using more swap than others.
Hi, Carlos, thank you for this suggestion. I did not know that. Here is the
current output,
```
Tasks: 254 total, 1 running, 253 sleeping, 0 stopped, 0 zombie
%Cpu(s): 6.8 us, 3.3 sy, 0.0 ni, 89.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0
st
MiB Mem : 23986.31+total, 7177.238 free, 5415.426 used, 11393.65+buff/cache
MiB Swap: 2051.996 total, 2051.793 free, 0.203 used. 16551.00+avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 189396 10452 7356 S 0.000 0.043 0:05.68 systemd
2 root 20 0 0 0 0 S 0.000 0.000 0:00.05 kthreadd
3 root 0 -20 0 0 0 I 0.000 0.000 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.000 0.000 0:00.00
rcu_par_gp
.........
```
Looks like it is systemd who used the most swap space.


However, I read from the above that it is using only 5 MB of swap, out
of a total of 2051 M. That's nothing! Mine is using 6 GB.
Maybe I am too alert on the usage of swap. I do not have a good understanding
on the usage of swap. I thought the OS should prefer RAM over swap in case
that free RAM is available. But after reading [this post](http://
northernmost.org/blog/swap-usage-5-years-later/), I think you are right.

--

Best regards,
ZHX


--
To unsubscribe, e-mail: opensuse-support+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-support+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References