I use Ubuntu 20.04 on my computer. When I use top -i
command, I see one of the users consume a high amount of CPU for kswapd0
. To terminate this, first of all I used ps -ax| grep kswapd0
and killed it. Then I used the following command to clear the page cache:
sync; echo 1 > /proc/sys/vm/drop_caches
And finally I restarted the computer. But, unfortunately, kswapd0
again appeared on top -i
command with high CPU consumption after rebooting the system.
I do not know what is it and how can I permanently kill it. Thanks for your commands
kswapd0
is "Kernel Swap Daemon", which is the process that manages the swap file for your system. If it is consuming a lot of CPU (and probably I/O), you'll want to see if your system is running out of memory or is working with a large number of open files. Dropping the cache is not really a solution as it'll all need to be read from storage again, and killing the process will just result in the kernel starting another instance. – matigo Feb 22 '23 at 12:52