0

I know the title is a bit ambiguous but that is what I have experienced few times this week.

These are the symptoms I have spotted:

  • mouse movements start to get choppy
  • music (YouTube in Firefox) stars to cut out (every second or so)
  • sometimes, after couple of minutes of the struggle, mouse stops completely, so does the sound
  • I cannot invoke Alt + F2, system is complely irresponsive

Now, I reviewed journal in search for a clue, but I have not enough knowledge to understand what could have got wrong.

Here is the snippet of a journal (around the time the total freeze occured):

https://paste.ubuntu.com/p/bJydGVGcKb/

The only things that stood up from the logs were gnome-shell and pulse-audio, but I cannot say whether those two causes it. I know from prior experience that gnome-shell sometimes outputs hundreds of JS error messages (per second).

The freeze started around 17:55 and the system recovered after 4-5 minutes.

UPDATE:

Output of free -h:

jovan@jovan-Z68X-UD5-B3:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           15Gi       5,2Gi       5,5Gi       174Mi       4,9Gi         9Gi
Swap:         2,0Gi       220Mi       1,8Gi

Output of lshw:

https://pastebin.ubuntu.com/p/ZKJbhjvgtZ/

Swappiness:

jovan@jovan-Z68X-UD5-B3:~$ sysctl vm.swappiness
vm.swappiness = 60

GNOME extensions (nothing in ~/.local, only in /usr):

jovan@jovan-Z68X-UD5-B3:~$ ls -al /usr/share/gnome-shell/extensions
total 20
drwxr-xr-x 5 root root 4096 апр 23 09:35 .
drwxr-xr-x 7 root root 4096 авг 19 06:54 ..
drwxr-xr-x 2 root root 4096 авг 14 20:13 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 апр 23 09:35 ubuntu-appindicators@ubuntu.com
drwxr-xr-x 3 root root 4096 јун 22 10:16 ubuntu-dock@ubuntu.com

SSD Disk SMART data:

enter image description here

  • Edit your question and show me free -h and sudo lshw -C memory and sysctl vm.swappiness and top and ls -al ~/.local/share/gnome-shell/extensions and ls -al /usr/share/gnome-shell/extensions, and screenshots of the Disks app SMART Data scrollable window. – heynnema Aug 23 '20 at 17:46
  • Do you have a GNOME Shell extension named workspacesView installed? – heynnema Aug 25 '20 at 15:25
  • @heynnema apologies for the delayed answer - I have updated the question with the data you asked :) thank :) – Jovan Perovic Aug 28 '20 at 08:40
  • From what I can grasp, my swap is too small... as far as I read online, for RAM sizes above 8GB, it should be 0.5 x RAM - in my case, it is 0.125 x RAM – Jovan Perovic Aug 28 '20 at 08:42
  • I have resized swap to 8GB and so I going to see if that helps. Whenever freeze happened, I had 15+ GB of RAM used and swap around 1.9/2G. – Jovan Perovic Aug 28 '20 at 09:08
  • Status please... – heynnema Sep 02 '20 at 02:13

2 Answers2

2

This are typical symptoms of:

  1. Bad spinning drive, bad sectors Or
  2. Using swap memory, so all the system slows down. Maybe you're using way more memory than you physically have and the system is using swap.

You can open a terminal and monitor the memory consumption with:

htop

Or

top

Or

free -h

Also check the swappiness. The default value of 60 is not appropriate in my opinion and you can change it to 10 probably:

sysctl vm.swappiness

Check the logs with grep -i "kill" I guess you'll see your system killing processes when it exhausts the RAM and swap.

Carles Mateo
  • 1,577
  • 6
  • 12
  • The drive is brand new SSD so I guess that should not be the issue. The second suggestion is more likely - it began chopping again 10 minutes ago. When I went to htop and it showed 15.2G/16G taken and swap was at the max. Anyways, Firefox was taking 4.5G of that :-o – Jovan Perovic Aug 23 '20 at 16:51
  • Recommending vm.swappiness=10 is not appropriate without having more data about this system. 60 was chosen for a reason. – heynnema Aug 23 '20 at 17:48
  • 1
    New hardware can come defective from fabric, but I think I see the problem. When you get to use all the memory starting new processes will fail, and the Linux Kernel will kill other processes. I have seen the effect that you describe (the mouse jumping and not responsive system) when Firefox is using lots of memory. If you start a fresh session and keep few tabs open you should have no problems. Also think that swap is writing and reading to disk. For an SSD is around 550 MB/sec max so your system will be slow if using swap memory intensively. – Carles Mateo Aug 24 '20 at 17:29
  • 1
    @CarlesMateo Yes, most like the swap is an issue. Since then I switched to Chrome and had only a single occurrence - this was due to running Docker container service which consumed a lot of RAM. Basically, whenever the RAM usage spikes above 15G, I get the freezing... – Jovan Perovic Aug 28 '20 at 08:44
1

BIOS

Gigabyte GA-Z68X-UD5-B3

You have BIOS version F6, from 5/10/2011.

There's a newer BIOS available, version F10, from 2/20/2012, and can be downloaded here.

Note: Confirm that I have the correct web page for your motherboard.

Note: Have good backups before updating the BIOS.

Swap

Your swap is kind of smallish. Let's increase it to 4G.

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections sudo mkswap /swapfile # init /swapfile sudo swapon /swapfile # turn on swap free -h # confirm 16G RAM and 4G swap

Confirm this line in /etc/fstab... and confirm no other “swap” lines...

/swapfile    none    swap    sw      0   0

reboot                    # reboot and verify operation
heynnema
  • 70,711
  • I have increased swap to 8GB and lowered vm.swappiness to 10. Overall system performance has increased even after I go above 13GB of RAM used. After a couple of days, today, I got a bit of a sluggish GUI interface (RAM was well below 5GB, swap at around 1GB), during which all apps behaved responsively, but switching between then was painfully slow (with 1s lag). I had a meeting so I had to resort to logout/login which restored performance... – Jovan Perovic Sep 03 '20 at 19:43
  • 1
    @JovanPerovic Good news! Your vm.swappiness=10 may be a little too aggressive. I'd suggest trying 40-70, depending on RAM usage. Understand that low settings favors RAM, whilst higher settings favor swap. – heynnema Sep 03 '20 at 20:09
  • Thanks, @heynnema, I am going to tweak that value a bit. As for the BIOS update, I am a bit uneasy about doing an upgrade... did BIOS upgrade of my laptop once, took me hours to recover from a crash. Not comparable, but still :) – Jovan Perovic Sep 03 '20 at 20:14
  • 1
    @JovanPerovic I understand your concern. However, because you're SO far behind with BIOS updates, I'd backup your files, and then do the update to F10. – heynnema Sep 03 '20 at 20:35