1

EDIT 2
While it didn't answer my original question, since increasing the swap to 4G I don't experience any more computer freezes, so I accepted the answer

EDIT

As @heyynema suggested, I ran the following operations enter image description here

I'll report back in a few days whether this has solved/improved the issue

OP

I'm running multiple dev related processes on my machine in the background, i.e. vscode, dev servers, etc

every once in a while my laptop kinda freezes almost entirely for about 30 seconds, and then everything goes back to normal.

during the "freeze" if I move my mouse I can see the cursor moving around very slowly with a huge lag.

Is there a way to identify which process is causing this?

I don't know much about memory and monitoring, is there an alert I should set up, i.e. "if any process exceeds X memory then log Y"?

enter image description here

goldylucks
  • 632
  • 2
  • 12
  • 23

1 Answers1

1

You have plenty of RAM. But historically a 2G /swapfile has proven to be too small. We'll increase yours from 2G to 4G...

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

In the terminal...

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

Edit /etc/fstab, using sudo -H gedit /etc/fstab or sudo pico /etc/fstab.

Confirm this /swapfile line in /etc/fstab... and confirm no other “swap” lines... use SPACES in this line... confirm NO TABS...

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation
heynnema
  • 70,711