HowTo: Check RAM Size In Ubuntu Linux

last updated in Categories , ,

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:


  • 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
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.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


12 comment

  1. 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

  2. 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 ??

  3. 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?

  4. 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

    1. 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

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

Leave a Comment