Short answer: yes, it is normal and you don't need to worry about it.
Long answer: linux does use some swap even if enough memory is available. The rationale is that caching recently read/written data can be more useful than keeping old, inactive program code & data in RAM. This bias can be modified via the swappiness
sysctl tunable. From the kernel docs:
swappiness
This control is used to define how aggressive the kernel will swap
memory pages. Higher values will increase aggressiveness, lower
values decrease the amount of swap. A value of 0 instructs the kernel
not to initiate swap until the amount of free and file-backed pages is
less than the high water mark in a zone.
The default value is 60.
If you really want to reduce swapping, you can lower the swappiness
value via sysctl vm.swappiness=10
or echo 10 > /proc/sys/vm/swappiness
. Remember that this is valid until a reboot; to keep it between reboots, you need to edit the /etc/sysctl.conf
file.
If you wan to completely disable swap, you can use swapoff -a
(commenting the relevant /etc/fstab
entry to let it persist between reboots).
vmstat
. If there was some peak which causes rarely used data to be shifted out to swap once, then it would be no big deal for it to sit there idle on disk. If the same quantity is getting swapped in and out continually then it is not the same.