HowTo: Check RAM Size In Ubuntu Linux

How do I check amount of RAM in my Ubuntu Linux laptop or desktop system/server using GUI and command line tools?

There are various commands on Ubuntu Linux that can show you total RAM, used and free ram as follows:
Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 2m
  • free command
  • top command
  • vmstat command
  • /proc/meminfo file.

Display available memory on Ubuntu Linux

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands to view amount of free and used memory in the system including total ram:

free -m

Sample outputs:

             total       used       free     shared    buffers     cached
Mem:          7997       2618       5378          0        126       1353
-/+ buffers/cache:       1139       6858
Swap:        15623          0      15623

You can also use the following command to get same info:

grep MemTotal /proc/meminfo

Sample outputs:

MemTotal:        8189496 kB

The above output indicates that I’ve total 8GiB ram. You can get detailed info by typing the following cat command:
$ cat /proc/meminfo
Sample outputs:

MemTotal:        2050424 kB
MemFree:          649088 kB
Buffers:          304844 kB
Cached:           920136 kB
SwapCached:            4 kB
Active:           803628 kB
Inactive:         431560 kB
Active(anon):       3988 kB
Inactive(anon):     8628 kB
Active(file):     799640 kB
Inactive(file):   422932 kB
Unevictable:        2944 kB
Mlocked:            2944 kB
SwapTotal:       3998716 kB
SwapFree:        3998712 kB
Dirty:                20 kB
Writeback:             0 kB
AnonPages:         13296 kB
Mapped:            10364 kB
Shmem:               336 kB
Slab:             118192 kB
SReclaimable:     101820 kB
SUnreclaim:        16372 kB
KernelStack:        1240 kB
PageTables:         1740 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5023928 kB
Committed_AS:      67748 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       30748 kB
VmallocChunk:   34359698708 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       52096 kB
DirectMap2M:     2043904 kB

Other commands

You can use other commands to get the same info:
$ vmstat
$ top
### you need to install htop ##
$ htop

Related media

This tutorial is also available in a quick video format:

Video 01: Ubuntu / Debian Linux Ram (Memory) Usage Command Line Tutorial

GUI Tool To Find Out RAM Size Under Ubuntu Linux

The System Monitor application enables you to display basic system information and monitor system processes, usage of system resources, and file systems. You can also use System Monitor to modify the behavior of your system. To see memory information graphically, click on System > Administration > System monitor:

Fig.01: Ubuntu Linux Display Installed Memory

A note about 3GB ram problem

If your Linux based system only shows 3 GB ram (it may be in the 2.9–3.5 GB range) even if you got more than 3GB installed. You can get around this barrier running on x86 microprocessors by following this tutorial. The barrier can be resolved by moving to a 64-bit processor and operating system. On certain x86 hardware, it is possible to resolve it by using physical address extension (PAE) mode on x86.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 12 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
12 comments… add one
  • colin little Mar 21, 2012 @ 14:58

    Hi,ive just purchased a linux ubunto 11.10 desktop,from ebay,but its very slow loading games,how do i resolve this,where can i buy memory upgrades from. thanks Colin Little

    • abc Oct 19, 2016 @ 6:54

      Sell it..

  • Will May 16, 2012 @ 12:51

    Thanks for this. Saved me some time.

  • sara Jul 31, 2012 @ 8:52

    hi, im using ubuntu 11.04 (natty)
    why it shows 2.9 GB of RAM using system monitor…i think my RAM should be 4 Gig
    where’s my 1.1 GB ??

    • Bobo_PK Sep 2, 2012 @ 1:50

      You are using a 32 bit version which can’t adress more then 3 GB. Use the 64 bit version to solve that!

      • 🐧 nixCraft Sep 2, 2012 @ 2:04

        The faq has been updated to address these issues.

  • Christian Feb 16, 2015 @ 20:40

    i have ubuntu 14.04 LTS, and this system error comes up a lot saying that i need to upgrade my video card, is that just a glitch or a virus, what is it, and what should i do?

  • hariom Jan 20, 2016 @ 8:23

    i m install ubuntu 15.10 64 bit
    but my 4gb ram is not so only so 2.9gb
    i m also following command
    free -m
    sudo dmidecode -t 17
    -t 17 so the 2,2gb ram in to too slots
    but not so total 4 gb ram
    pls tall me what type of command run in my system

    • sadik Oct 9, 2017 @ 6:13

      first do this cmd in terminal
      (1) sudo apt-get update
      after second command
      (2) sudo apt-get install linux-generic-pae linux-headers-generic-pae
      this command download approx 32 mb and after auto apply and reboot require so reboot pc and check

  • hawk Feb 13, 2016 @ 21:12

    always a great help

  • undrline Jun 19, 2016 @ 14:47

    oh. I was looking for how to find max supported ram of mobo via xubuntu tools …

    • undrline Jun 19, 2016 @ 14:51

      … found it. This will tell you the max supported ram by your system and number of slots.
      sudo dmidecode -t 16

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum