1

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

Martin
  • 11
  • 3
    Welcome to AskUbuntu. 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
  • 2
    Does this answer your question? kswapd0 is taking a lot of cpu – Criggie Sep 06 '23 at 01:25
  • The answer is available at: https://askubuntu.com/questions/1224927/cpu-100-with-kswapd0-process-although-no-swap-is-needed – Martin Feb 11 '24 at 10:51

0 Answers0