0

I'm having an issue with Pop!_OS 20.04. Basically, after running for long enough, my buffer/cache fills up(I've read that this is completely normal) and my avail memory decreases. Eventually my computer starts to try to swap memory and the kswapd process starts. When this occurs my computer completely freezes up and becomes unusable and a hard restart is required. A couple of example outputs from top shortly before this occurs are below.

top - 20:01:56 up  2:20,  1 user,  load average: 0.89, 0.89, 0.96
Tasks: 273 total,   2 running, 271 sleeping,   0 stopped,   0 zombie
%Cpu(s): 15.2 us,  3.5 sy,  0.0 ni, 80.9 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   7916.1 total,    156.4 free,   3212.3 used,   4547.4 buff/cache
MiB Swap:   4095.5 total,   2097.5 free,   1998.0 used.    118.5 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                
   5717 bob       20   0 6981324 529316  40100 S  52.5   6.5  93:20.71 WoWClassic.exe         
   1895 bob       -2   0 6984436  84200  17752 S   5.3   1.0   2:31.27 gnome-shell            
   1614 bob       20   0 4878928  24088   3960 S   8.6   0.3   5:45.16 Xorg                   
   2214 bob       20   0  639644  19208   8840 S   4.3   0.2   0:27.15 gnome-terminal-        
   2349 bob       20   0 2091024   7800   2096 S   0.3   0.1   0:48.83 io.elementary.a        
   1219 geoclue   20   0  584040   6000   4044 S   0.0   0.1   0:00.41 geoclue                
   1733 bob       20   0  323980   4896   1724 S   1.0   0.1   0:14.02 ibus-daemon            
      1 root      20   0  167800   4536   1292 S   0.3   0.1   0:18.14 systemd                
    876 root      20   0  394572   4448   1940 S   0.3   0.1   0:09.84 udisksd                
   1836 bob       20   0  505000   4280   2116 S   0.3   0.1   0:00.59 xdg-desktop-por        
    445 root      19  -1   70136   4272   3608 S   0.0   0.1   0:00.71 systemd-journal  

top - 20:16:50 up  2:35,  1 user,  load average: 0.88, 0.41, 0.70
Tasks: 274 total,   1 running, 273 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.6 us,  0.2 sy,  0.0 ni, 99.2 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   7916.1 total,    459.5 free,   2943.0 used,   4513.6 buff/cache
MiB Swap:   4095.5 total,   2300.2 free,   1795.3 used.    526.9 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                
   1614 bob       20   0 5060228  37668  11568 S   4.0   0.5   6:02.94 Xorg                   
   2214 bob       20   0  639644  28544  17288 S   3.7   0.4   0:30.20 gnome-terminal-        
   1895 bob       -2   0 7291972 211512  64668 S   3.0   2.6   2:50.37 gnome-shell            
      1 root      20   0  167800   6812   3568 S   0.3   0.1   0:18.68 systemd                
    838 root      20   0  419244   5876   4464 S   0.3   0.1   0:01.53 NetworkManager         
   1733 bob       20   0  323980   7052   2484 S   0.3   0.1   0:14.62 ibus-daemon            
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kthreadd               
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp                 
      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp             
      6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0H-kblockd   
      9 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq           
     10 root      20   0       0      0      0 S   0.0   0.0   0:00.21 ksoftirqd/0            
     11 root      20   0       0      0      0 I   0.0   0.0   0:10.40 rcu_sched              
     12 root      rt   0       0      0      0 S   0.0   0.0   0:00.02 migration/0            
     13 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 idle_inject/0   

As you can see, the buffer/cache is fairly large and using over half of my available memory. This generally slowly increases with time as my computer is on. Eventually it get's large enough and my computer freezes and the hard reboot becomes necessary.

Thus far the only thing I've really tried was to change my swappiness to 0 by adding vm.swappiness=0 to /etc/sysctl.conf but that hasn't helped.

Aside from periodically rebooting when my cache/buffer gets high and my avail mem gets low, what else can I do to prevent this freezing from kswapd running amok?

4
  • The kernel generally hands back buffer/cache if your system really needed RAM, and so I don’t see kswapd being the issue. What is slow? Your load doesn’t appear high nor is anything using much resources.
    – jsbillings
    Commented Sep 13, 2020 at 22:56
  • The entire system is slow and unresponsive. It freezes to the point where I cannot even move the mouse cursor. I let it sit for upwards of 15 minutes but is still frozen. After which I hard reset using the power button. Commented Sep 13, 2020 at 23:25
  • The top output doesn’t look like anything causing slowness. Anything in dmesg or the journal when it starts to lag?
    – jsbillings
    Commented Sep 14, 2020 at 0:43
  • Is there a way I can check what happened in dmesg before the reboot? Everytime I check dmesg after starting up it only seems to begin at boot time. /var/log/syslog does not show anything helpful Commented Sep 15, 2020 at 12:38

1 Answer 1

0

That probably means some process is leaking memory (or just using way too much of it), filling it up with garbage. Once memory is full, it eats into swap. Disk is s.l.o.w., thus too much (random) access to the (overused) memory forces the system into a crawl.

Look at ths size of the processes in ps(1) output, it should point at the culprit(s).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .