Skip to content

Ubuntu 20.04 freezing after suspend solution

I had an issue with Ubuntu freezing after suspending the system. When I tried to wake up the OS, I’d hear the ventilator restarting, the keyboard lights would turn on, but the screen remained black. No way of getting the system back, besides a hard (or soft) reset.

TLDR: If nothing else works for you, verify you’re using the recommended swap size for Ubuntu and increase it if needed.

Diagnosis

I had used been using Ubuntu 20.04 with no issues for almost 2 years. For no apparent reason, my system started freezing after suspend. I tried many proposed fixes (see the next section), but the problem persisted.

Finally, I decided to completely reinstall the system. Since the suspend function had been working fine before, it should work again in a fresh installation.

Reinstalling seemed to solve the problem for some time. However, as I started setting up Ubuntu and installing new applications, the problem arose again. The OS would freeze after suspend.

Common solutions (that didn’t work for me)

Some reported solutions to this problem:

  • Modifying your grub configuration.
  • Updating your Nvida drivers (if applicable).
  • Switching your display manager from gdm3 to lightdm.

Solution: Increase SWAP size

I then realized that issue appeared as my disk memory started running low.

For my fresh installation, I allocated more disk space. I also used the default Ubuntu new system configurations, which allocated 2 GB of swap memory.

But this new setup didn’t work very well. Besides the suspend freeze issues that reappeared, my system would crash when I was running too many applications at the same time. htop revealed that in those situations my swap memory was almost full.

That’s when I decided to increase my swap memory and run across this Ubuntu system recommendation for the swap size:

If hibernation is used, swap size should be equal to size of RAM plus the square root of the RAM size.

It’s FOSS

For example, if you have 8 GB of RAM, you should allocate about 11 GB for swap size.

To my great surprise, increasing the swap size not only remediated the system crashes, but also the suspend freezes! Yay!

So, if you’re system does not wake up after suspend, verify your swap size and increase it if necessary. You can follow this guide.

Published inArticles
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
walter white
walter white
7 months ago

hi, the hibernation and suspend they are different aspects ,so logically they need different solution .
the title : ubuntu freezing after suspend
the solution : is about hibernation

Last edited 7 months ago by walter white
William
William
5 months ago

So far increasing the swap seems to work! Thanks!