3

After the computer is opened for a while, at some point it gets extremely slow. It's not that it freezes, because if you move the mouse you can see that after 10-20 seconds moves a bit. I also tried to enter the terminal using Ctrl + Alt + F1 but the same happens. To write a single letter takes minutes. I tried to execute top or ps aux for example but it takes forever.

Command output execution just after startup machine:

  • swapon --show
$ swapon --show
NAME      TYPE      SIZE USED PRIO
/dev/sda6 partition 976M   0B   -2
  • top
Tasks: 212 total,   1 running, 148 sleeping,   0 stopped,   0 zombie
%Cpu(s):  6,8 us,  3,4 sy,  0,0 ni, 89,1 id,  0,5 wa,  0,0 hi,  0,1 si,  0,0 st
KiB Mem :  3952020 total,  2405260 free,   625092 used,   921668 buff/cache
KiB Swap:   999420 total,   999420 free,        0 used.  2707928 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                     
 2372 joel      20   0  675348  36620  29032 S   6,2  0,9   0:01.13 gnome-terminal-                             
    1 root      20   0  185692   6136   3948 S   0,0  0,2   0:01.78 systemd                                     
    2 root      20   0       0      0      0 S   0,0  0,0   0:00.00 kthreadd                                    
    3 root      20   0       0      0      0 I   0,0  0,0   0:00.00 kworker/0:0                                 
    4 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 kworker/0:0H                                
    5 root      20   0       0      0      0 I   0,0  0,0   0:00.06 kworker/u8:0                                
    6 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 mm_percpu_wq                                
    7 root      20   0       0      0      0 S   0,0  0,0   0:00.02 ksoftirqd/0                                 
    8 root      20   0       0      0      0 I   0,0  0,0   0:00.15 rcu_sched                                   
    9 root      20   0       0      0      0 I   0,0  0,0   0:00.00 rcu_bh                                      
   10 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 migration/0                                 
   11 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 watchdog/0                                  
   12 root      20   0       0      0      0 S   0,0  0,0   0:00.00 cpuhp/0                                     
   13 root      20   0       0      0      0 S   0,0  0,0   0:00.00 cpuhp/1                                     
   14 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 watchdog/1                                  
   15 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 migration/1                                 
   16 root      20   0       0      0      0 S   0,0  0,0   0:00.02 ksoftirqd/1                                 
   17 root      20   0       0      0      0 I   0,0  0,0   0:00.00 kworker/1:0                                 
   18 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 kworker/1:0H                                
   19 root      20   0       0      0      0 S   0,0  0,0   0:00.00 cpuhp/2                                     
   20 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 watchdog/2                                  
   21 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 migration/2                                 
   22 root      20   0       0      0      0 S   0,0  0,0   0:00.01 ksoftirqd/2                                 
   23 root      20   0       0      0      0 I   0,0  0,0   0:00.00 kworker/2:0                                 
   24 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 kworker/2:0H                                
   25 root      20   0       0      0      0 S   0,0  0,0   0:00.00 cpuhp/3                                     
   26 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 watchdog/3                                  
   27 root      rt   0       0      0      0 S   0,0  0,0   0:00.00 migration/3                                 
   28 root      20   0       0      0      0 S   0,0  0,0   0:00.00 ksoftirqd/3                                 
   29 root      20   0       0      0      0 I   0,0  0,0   0:00.02 kworker/3:0                                                          

Command output execution when the machine is slow:

  • swapon --show
$ swapon --show
NAME      TYPE      SIZE USED PRIO
/dev/sda6 partition 976M 976M   -2
  • top I could not manage to get a proper text output but I can tell that the process kswapd2 was consuming from 80% to 100% CPU.

Observations with htop

I keept monitoring my computer untill it became super slow and found out that it starts to get very slow when it runs out of swap. Due to big amount of firefox windows and the VirtualBox running a Ubuntu 18.04 server a lot of ram is used.

I managed to kill VirtualBox from the terminal opened with Alt+Shift+F2 and the system became usable again, although the swap usage didn't went down any more from 950M aprox.

joelac
  • 66
  • 3
    Please open a new terminal window after booting with Ctrl-Alt-F2 and do swapon --show && top then copy the results, do Ctrl-Alt-F1, and paste them into your question with [edit]. run your apps as you would normally. When the PC slows down, switch into the other terminal window with Ctrl-Alt-F2 again, then tap the up arrow cursor key and hit Enter. That will repeat the previous line run in that window. Hand copy the results, reboot, then come back here and provide the new results with [edit]. Please do not click Add Comment; instead, use [edit]. – K7AAY Sep 26 '19 at 17:05
  • 1
    Install htop sudo apt install htop then immediately it boots, open up a terminal and type htop. Leave it running on one half of the screen and then do your normal routine while keeping an eye on the processes and cpu usage in the htop terminal tab. – Parto Sep 27 '19 at 10:23
  • I kept executing top and swap --show before the pc slowed down and just before it became unusable swap was completely full (976M out of 976M) but nothing appeared to be consuming a lot of cpu. I'm trying to get the results of the executions (top and swap) when it slows down on two files and I'll post them when I have them. I'm also running htop to keep an eye on the processes. – joelac Sep 27 '19 at 13:17
  • 1
    @joelac You just need more swap space. Please refer to this answer: https://askubuntu.com/a/1165500/968501 and follow the instructions to create a swapfile and use it. Best of luck – Raffa Sep 27 '19 at 22:29

0 Answers0