1

My computer is a bit old and sometimes it struggles to handle many tabs running small processes etc. I guess this has to do with the ram.

When I check the usage, this is what I get:

free -lhm
              total        used        free      shared  buff/cache   available
Mem:          3.6Gi       2.4Gi       585Mi        24Mi       651Mi       957Mi
Low:          3.6Gi       3.1Gi       585Mi
High:            0B          0B          0B
Swap:         2.0Gi       539Mi       1.5Gi

I wonder if the Swap should be this large, and if not, how could I resize it safely.

Details

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal
Arch: x64
Swap: file (not partition)

1 Answers1

1

In new installations of Ubuntu 20.04 a 1.5GB swap file (not a swap partition) is created by default in the /partition. A swap file is also created by default in new installations of Ubuntu 17.04 and later. The swap file is resized automatically when more swap space is needed, but it is always at least 1.5GB.

If you are using an operating system that was upgraded from an OS that was installed before 17.04 then your OS probably has a separate swap partition. In general it is recommended that the swap partition be 1.5-2 times the amount of RAM if your computer has 4GB of RAM or less. It is not necessary to have a swap partition that is larger than 8GB in most cases.

Lightweight flavors of Ubuntu require less RAM and therefore they also require less swap space.

enter image description here
RAM Usage of different flavors of 18.04 under baseline conditions  (Click image to enlarge)

karel
  • 122,292
  • 133
  • 301
  • 332