Score:0

Freezes in 20.04.2. No idea how to troubleshoot

gb flag

I'm brand new to Linux and Ubuntu and need a little help. I'm running 20.04.2 and frequently my system freezes up completely. I have zero knowledge of how to troubleshoot this problem. So far to restart I have been using Alt+PrtScrn+REISUB. Normally if I'm playing music on spotify it will continue despite everything else having frozen.

EDIT: I seem to have the most problems when running PyCharm.

EDIT2: This is my free -h and sysctl vm.swappiness

guiverc avatar
cn flag
Since you can use the SysRq keys (REISUB) to tell the system to safely reboot; you know the linux kernel is up & working as you can give it the command REISUB & it is responding. As a clean shutdown occurred, you can search systemd logs (`journalctl`) to look for clues; as they survive reboot (`dmesg` messages do not). I'd also try using Ctrl+Alt+F4 to switch to a text terminal & try logging in.. This will allow exploration of the system before rebooting, and allow you to test theories on why it's freezing, also it'll tell you only the GUI is freezing.
us flag
Do you have enough RAM? Consider setting up swap, upgrading your RAM, or switching to a lighter distribution like Lubuntu or Xubuntu.
karel avatar
sa flag
Does this answer your question? [Ubuntu freezes randomly with audio playing in the background](https://askubuntu.com/questions/1247855/ubuntu-freezes-randomly-with-audio-playing-in-the-background)
Rwzfs avatar
gb flag
@ArchismanPanigrahi Very beginner question coming up - how can I tell if I'm running out of RAM? The PC I'm using has 8GB.
us flag
Open System Monitor when you run PyCharm, and you can see the amount of RAM being used. 8 GB is otherwise more than enough to run Ubuntu, unless PyCharm consumes too much RAM.
heynnema avatar
ru flag
Edit your question and show me `free -h` and `sysctl vm.swappiness`. Start comments to me with @heynnema or I'll miss them.
Rwzfs avatar
gb flag
@guiverc Ctrl+Alt+F4 didn't work.
Rwzfs avatar
gb flag
@ArchismanPanigrahi It says that PyCharm is using 1GB of RAM.
Rwzfs avatar
gb flag
@heynnema Included in the question the info you're looking for.
heynnema avatar
ru flag
@Rwzfs Status please...
Score:0
ru flag

Your 2G /swapfile is too small. Let's increase it 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 8G 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
Rwzfs avatar
gb flag
Just did this. The swap has worked in that it increased from 2G to 4G, just waiting now to see if it fixes the freezes. Will update later today to see.
Rwzfs avatar
gb flag
Increasing to 4GB still had freezes. Upped it to 11 and still have had freezes.
heynnema avatar
ru flag
@Rwzfs Reduce your swap back down to 4G. Show me `sudo dmidecode -s bios-version` and tell me the EXACT make/model of your computer or motherboard.
Rwzfs avatar
gb flag
Bios version 7.11. Motherboard is Foxconn 2ABF. @heynnema
heynnema avatar
ru flag
@Rwzfs Is this a HP computer? If so, give me the model # for that. I'm having trouble finding the proper BIOS update for you.
Rwzfs avatar
gb flag
It's a computer I've built, but it shows a HP splash screen when I turn it on. Is it a model# for a specific part?
heynnema avatar
ru flag
@Rwzfs Sounds like your motherboard came from a HP computer, but without a HP model #, I can't find the BIOS update for it at https://support.hp.com. The Foxconn web site isn't helpful either. You may have to do some research on your own to try and find it.
heynnema avatar
ru flag
@Rwzfs Did you reboot after increasing the /swapfile size?
Rwzfs avatar
gb flag
Hmm okay I'm not sure how I'll be able to find it, I'll do some digging. Pretty sure I did, but I can try again. Should I increase the swapfile size back to ~11G? I read someone else say to put it as 1.5x your RAM.
heynnema avatar
ru flag
@Rwzfs No, swap at 4G is more than enough. (1.5 x RAM) is very old school thinking. Try this... at the GRUB menu, choose Additional Options, and select an older kernel to boot from, and see if there's any improvement.
Score:-1
it flag

System "freezes" are often caused by running too many, too large programs and running out of available memory. Use free to see if you have swap space, read man mkswap swapon fstab to create some. Swap space must be contiguous. use mkswap or fallocate, not dd. Traditionally, swap space of 1.5 × RAM has been recommended, but YMMV. If you don't plan to hibernate your system, you can have less than 1.0 × RAM.

Rwzfs avatar
gb flag
So when I input `man mkswap swapon fstab` I get a big block of text and I'm not quite sure what to do next. I put a photo in the main question that shows my swap space to be 2GB, should I then make this 8GB? How do I go about doing this?
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.