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 ?

user227495
  • 4,089
  • 17
  • 56
  • 101
  • 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 02 '19 at 06:28
  • Actually, both 18.04 and Windows 10 dual boot is showing 4GB RAM ( that is all laptop has ). I am worried about the 2GB consumption by 18.04 even when no program is running. – user227495 Dec 02 '19 at 06:35
  • 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). – trond hansen Dec 02 '19 at 07:08
  • 2
    https://askubuntu.com/questions/1134523/how-to-solve-ram-usage-excessive-on-ubuntu-18-04-2-lts – Rinzwind Dec 02 '19 at 07:21
  • @Rinzwind should I increase the swap size ? – user227495 Dec 02 '19 at 07:29
  • @user227495 It doesn't look like you are using much swap space so increasing space may not help. Changing your swappiness (which is not the same as your swap size) may help or it might slow things down (don't always believe that using lower swappiness will speed things up because it may slow things down in the long run). If you want help regarding swappiness, then include the output from the following command in your question: cat /proc/sys/vm/swappiness. – mchid Dec 02 '19 at 07:44
  • 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 02 '19 at 07: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 02 '19 at 14:48
  • That you only see 2 GB rather than the installed 4 would lead me to expect a hardware problem. – vanadium Dec 02 '19 at 14:54

4 Answers4

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
mchid
  • 43,546
  • 8
  • 97
  • 150
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.

Jan
  • 199
  • Things were a bit better with Cinnamon. Which DE is Lubuntu ? I am ok with a light DE. Thanks. Upvoted. – user227495 Dec 02 '19 at 07: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 02 '19 at 08: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 02 '19 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 02 '19 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.

Douglas.M
  • 36
  • 3
  • 2
    Kernel caches programs in RAM as you may reuse them. Linux ate my RAM! - memory use cache http://www.linuxatemyram.com/ Difference between Details screen on RAM and free command http://askubuntu.com/questions/743649/new-16gb-of-ram-installed-yet-i-see-15-3-on-my-system-why?noredirect=1#comment1106622_743649 & https://askubuntu.com/questions/184217/why-most-people-recommend-to-reduce-swappiness-to-10-20/184221#184221 – oldfred Dec 02 '19 at 15:58
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.