5

I have a 4GB RAM laptop. During last week, my system was freezing a lot. When I checked the stats, it said 2 GB or RAM and 1 GB cache is in use. The load is some 1.2 or similar. So I reinstalled 18.04 and a couple of regular programs. But even with everything closed, the zero used session still shows 2 GB RAM consumption is system load indicator. Please check the screenshot below.

I want to know whether this a normal thing or I should be worried about my hardware. Thanks.

enter image description here

A little background info. Before this fresh install of 18.04, I had an incomplete AMPPS install. Also Inkscape ( which I installed from PPA ) was crashing every now and then during last 2 weeks.

Update 1 :

$ swapon
NAME      TYPE SIZE USED PRIO
/swapfile file   2G 2.5M   -2

Should I increase the swap size ?

Update 2 :

Will using gnome classic DE do any good ?

9
  • 8
    I would go into your machine's BIOS and see how much RAM it detects is available. It could be POST (power on self-test) has detected issues with a ram module and thus your hardware is ignoring it (which is done before Ubuntu boots, so changes in Ubuntu will achieve nothing). I'd also likely run memtest86() your system possibly already has installed (via grub).
    – guiverc
    Dec 2, 2019 at 6:28
  • 4
    i have an ancient toshiba tecra 2G ram ubuntu 18.04.3.directly after startup less than 1G ram and 0%swap is used so something is stealing your memory,i have only the common extra programs installed(synaptic-stacer-bleachbit). Dec 2, 2019 at 7:08
  • 2
  • 1
    @user227495 However, the answer for the linked question says to add zram to your setup. I use zram along with regular swap, on 4GB of RAM, with an SSD instead of a hard drive on a toshiba laptop from ~2012 and things run fast. However, I currently have nothing running and my memory use is 2.0 GB, cache 1.8 GB but I also have 4GB of swap space.
    – mchid
    Dec 2, 2019 at 7:50
  • 3
    Also keep in mind your "cache" size, that's 'reserved' by the OS but not actually in use. And 897MB of the 1.8GB is cache space that'll be released as needed to the rest of the system as needed (so 1.0GB of RAM is in use, which is not atypical for a GUI of Ubuntu 18.04 because it's GNOME and needs more resources)
    – Thomas Ward
    Dec 2, 2019 at 14:48

4 Answers 4

4

But even with everything closed, the zero used session still shows 2 GB RAM consumption is system load indicator . . . I want to know whether this a normal thing or I should be worried about my hardware. Thanks.

I think this is normal because my system also has the same memory usage. I currently have nothing running and my memory use is 2.0 GB, cache 1.8 GB but I also have 4 GB of swap space (2 GB swapfile and 2 GB zram) and my swappiness is set to 10.

I use zram along with regular swap, on 4GB of RAM, with an SSD instead of a hard drive on a Toshiba laptop with an old-generation i3 processor from ~2012 and things run smoothly.


How to find out how much swap space I have ?

Use swapon to find out how much swap space you have.

Should I increase it ? If yes, how to do that ?

I do not recommend you increase the size of your swap file but I do recommend using zram to increase your overall swap size.

Using zram will automatically add 1/2 of your RAM size to your swap size without the diminishing returns of a swapfile (HDD access is about 10³ slower then RAM access).

To increase your swap space using zram, you can run the following commands:

sudo apt update
sudo apt install zram-config
sudo systemctl enable zram-config
sudo systemctl start zram-config

To verify that zram is in use, run: swapon and zram should be listed.

Here is an example:

~$ swapon
NAME       TYPE        SIZE   USED PRIO
/swapfile  file          2G 101.9M   -2
/dev/zram0 partition 486.1M 209.3M    5
/dev/zram1 partition 486.1M 210.1M    5
/dev/zram2 partition 486.1M 208.6M    5
/dev/zram3 partition 486.1M 206.8M    5
4
  • 2
    Note that not all SSDs are the same as some are faster than others so it is best to compare the advertised specs.
    – mchid
    Dec 2, 2019 at 8:13
  • How to find out how much swap space I have ? Should I increase it ? If yes, how to do that ? Thanks.
    – user227495
    Dec 3, 2019 at 1:24
  • 1
    @user227495 According to your swapon command, it looks like you have a 2 GB swapfile. Upon further investigation, I found out that I have a 2 GB swap file but I also have ~2 GB zram swap which totals ~4 GB. Adding zram should increase your swap space.
    – mchid
    Dec 3, 2019 at 2:04
  • 1
    @user227495 According to the Ubuntu help docs your swapfile size only needs to be the square root of your RAM size.
    – mchid
    Dec 3, 2019 at 2:53
3

The Ubuntu wiki advises that the minimum system requirements include 4 GB of RAM for Ubuntu Desktop. That would be for Ubuntu only, not taking running of applications into account.

https://help.ubuntu.com/community/Installation/SystemRequirements

What you could consider is to use a more lightweight variant of Ubuntu. That same webpage has some suggestions, listed at the bottom of the page. Alternatively, if possible, you could consider to increase the amount of RAM in your computer.

4
  • Things were a bit better with Cinnamon. Which DE is Lubuntu ? I am ok with a light DE. Thanks. Upvoted.
    – user227495
    Dec 2, 2019 at 7:35
  • “That would be for Ubuntu only, not taking running of applications into account.” Are you sure? I thought it should reckon the applications included in a standard OS installation, like Firefox, LibreOffice, etc.
    – Melebius
    Dec 2, 2019 at 8:30
  • 2
    @Melebius it does not take into account the heavy RAM usage of other applications beyond the 'typical' one or two Firefox tabs and maybe some open applications. For heavier uses, et. 4GB is the minimum whereas I'd recommend twice that for regular use stuff because of known GNOME memleaks
    – Thomas Ward
    Dec 2, 2019 at 14:49
  • To add a data-point: I am using old laptops with only 2 GB RAM or less just fine. With lightdm and XFCE as configured in Xubuntu, you can have a system which uses less than 0.5 GB RAM while idle.
    – Hermann
    Dec 2, 2019 at 18:48
2

System memory usage and memory allocation are adjusted depending on available memory of the system on the specific hardware. Depending on many variables, the actual used memory may differ from system to system. In general as long as the system is not running out of memory, having a higher than expected memory usage is not something to worry about.

1
1

There's a known issue with some devices running Gnome used in Ubuntu 16.04 to 18.04 leaking RAM due to a bug with Gnome 3. You can read more about this at: https://gitlab.gnome.org/GNOME/gnome-shell/issues/64

Workstations we own have not had that issue since updating to 19.04 or test machines running 19.10.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .