Score:1

how to Identify which process is causing computer to freeze?

ru flag

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

us flag
Keep system monitor open, and look at the process consuming the highest amount of memory.
heynnema avatar
ru flag
Edit your question and show me `free -h` and `sysctl vm.swappiness` and `swapon -s`. Start comments to me with @heynnema or I'll miss them.
ru flag
@heynnema added the output of these commands :)
ru flag
@ArchismanPanigrahi I can't do that because in these "freeze" times I can't switch to any window, everything is kinda not responding
heynnema avatar
ru flag
Status please...
ru flag
Sry had a hectic time at work. updated OP with the outputs of your suggestions. Will report back in a few days! (and of course accept the answer if things improve :)
Score:1
ru flag

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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.