Ubuntu 20.04 crashes randomly

I have installed Ubuntu 20.04 on my laptop and have been using it for 3 weeks. In the beginning it crashed twice at random times, but I didn't face the problem till today, when It crashed 3 times while running Android Studio.


Solution 1:

Try this..

Add a dedicated swap file or partition of 2x ram.

In my case was solved by adding 16G of swap but later I decided to bought more ram.

if you already have a /swapfile it is about 2G by default. to disable it you need to execute..

sudo swapoff /swapfile

then do...

sudo dd if=/dev/zero of=/swapfile bs=1MiB count=$((16*1024))
sudo mkswap /swapfile
sudo swapon /swapfile

then add a line to /etc/fstab like this

/swapfile swap swap defaults 0 0

now you should be able to run Android Studio without problems.

try it. regards.